Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI background color #16

Open
adicl opened this issue Nov 25, 2020 · 3 comments
Open

CLI background color #16

adicl opened this issue Nov 25, 2020 · 3 comments

Comments

@adicl
Copy link

adicl commented Nov 25, 2020

I'm using the Alpine version under UNRAID and I have problems with the color of the text in the CLI.
Some of the text (usually debug messages) is displayed black on dark grey background (see attached screenshot) and therefore barely readable. After such a line is displayed also the color of the commands typed afterwards becomes black on dark grey.
Initially I thought that there is a problem with my specific asterisk configuration, or the TERMINAL settings or the Docker configurations....
After some hair pulling I realized that the culprit is the -W from the asterisk command line from docker-entrypoint.sh

if [ "$1" = "" ]; then
  COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
else

-W Display colored terminal text as if the background were white or otherwise light in color. Normally, terminal text is displayed as if the background were black or otherwise dark in color.

Given that normally the linux console has a black background I think that this setting is inconvenient for most of the people.
Could you please change this to -B instead or eventually make it configurable?
Of course, you already provided a nice mechanism to override the entire COMMAND, however maybe some people, just like me, will have difficulties to figure out from where the problem comes in the first place.

Thanks and keep up the good work!
asterisk

@andrius
Copy link
Owner

andrius commented Dec 8, 2020

Thanks!

There is no option for -B, I will refactor image builder and will make colours options configurable

/ # asterisk -h
Asterisk 16.7.0, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Usage: asterisk [OPTIONS]
Valid Options:
   -V              Display version number and exit
   -C <configfile> Use an alternate configuration file
   -G <group>      Run as a group other than the caller
   -U <user>       Run as a user other than the caller
   -c              Provide console CLI
   -d              Increase debugging (multiple d's = more debugging)
   -f              Do not fork
   -F              Always fork
   -g              Dump core in case of a crash
   -h              This help screen
   -i              Initialize crypto keys at startup
   -L <load>       Limit the maximum load average before rejecting new calls
   -M <value>      Limit the maximum number of calls to the specified value
   -m              Mute debugging and console output on the console
   -n              Disable console colorization
   -p              Run as pseudo-realtime thread
   -q              Quiet mode (suppress output)
   -r              Connect to Asterisk on this machine
   -R              Same as -r, except attempt to reconnect if disconnected
   -s <socket>     Connect to Asterisk via socket <socket> (only valid with -r)
   -t              Record soundfiles in /var/tmp and move them where they
                   belong after they are done
   -T              Display the time in [Mmm dd hh:mm:ss] format for each line
                   of output to the CLI
   -v              Increase verbosity (multiple v's = more verbose)
   -x <cmd>        Execute command <cmd> (implies -r)
   -X              Enable use of #exec in asterisk.conf
   -W              Adjust terminal colors to compensate for a light background

@adicl
Copy link
Author

adicl commented Dec 8, 2020

Thank you very much for considering this small improvement!
Indeed - the -B is not between the switches displayed by the help command - apparently they forgot it - but for sure it is handled in the code:
https://github.com/asterisk/asterisk/blob/7d96b3e43746c2f3a16314acead2be53ee83f3d3/main/asterisk.c#L3570
and it seems to work fine on my side (notice the text background change from dark grey to black)

image

@blieb
Copy link

blieb commented Oct 5, 2022

I see this is still a issue in asterisk 18. When a black notice/warning come in the terminal stays black. Should this not reset to default instead of switching it to black?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants