[Home]

Summary:ASTERISK-25695: safe_asterisk -c breaks color in asterisk -r because of missing TERM for /dev/tty.
Reporter:Walter Doekes (wdoekes)Labels:
Date Opened:2016-01-14 06:45:15.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Core/General
Versions:11.20.0 13.6.0 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-25587 Libedit2 colored prompt is broken beyond repair
is related toASTERISK-25585 [patch]rasterisk never hits most of main(), but it's assumed to
Environment:Attachments:( 0) ASTERISK-25695_safe_asterisk_TERM.patch
Description:Unfortunately, color support isn't sane yet.

If asterisk is started with console=yes and the TERM environment variable isn't set to something that supports color, then {{asterisk -r}} doesn't get any color.

In fact, we're talking two bugs:
(1) safe_asterisk default settings break color support in rasterisk.
(2) Asterisk reads TERM in the master process to decide whether color support should be enabled in data fed to the rasterisken.

Quickest/partial fix would be to fix 1:
for example, we could do this (see {{ASTERISK-25695_safe_asterisk_TERM.patch}}):
{noformat}
       if test "$CONSOLE" != "no"; then
+               # If TERM is not set, the rasterisk would get no color.
+               # Set to safe default for BSD and Linux.
+               test -z "$TERM" && export TERM=xterm
               ASTARGS="${ASTARGS} -c"
       fi
{noformat}

However, that might enable color support for several installations, and that would cause more visibility to the fact that the {{-n}} option does absolutely nothing (ooh, bug number (3)!) -- except disable color support on the application itself, but not for feeding back/forth data from the (colorized) asterisk daemon.
Comments:By: Asterisk Team (asteriskteam) 2016-01-14 06:45:17.340-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Rusty Newton (rnewton) 2016-01-14 07:08:01.266-0600

/me shakes fist at the color support

Would you mind attaching the patch? We typically don't accept inline patches, even one liners. The link between your license agreement and the patch in our system is based on the patch file attachment to either JIRA or submission in Gerrit.