Hello, how can I change the color of the asterisk prompt to red ? I read in the wiki that I can use %Cn[;n] https://wiki.asterisk.org/wiki/display/AST/Asterisk+CLI+Configuration But what does this mean ? There is no example how to actually use it. where do I put it? What syntax is that anyway? How do I specify red ? I currently have this in my environment: export ASTERISK_PROMPT="[%H]: " which changes the prompt to hostname Ho can I make this prompt red ? thanks,
Have you tried adding ANSI color escape codes? There's lots of documentation for BASH prompt color using escape codes. Give those a try. (I haven't tried it, but would make sense) -----Original Message----- From: asterisk-users [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Fourhundred Thecat Sent: Sunday, May 31, 2020 9:45 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] CLI color prompt Hello, how can I change the color of the asterisk prompt to red ? I read in the wiki that I can use %Cn[;n] https://wiki.asterisk.org/wiki/display/AST/Asterisk+CLI+Configuration But what does this mean ? There is no example how to actually use it. where do I put it? What syntax is that anyway? How do I specify red ? I currently have this in my environment: export ASTERISK_PROMPT="[%H]: " which changes the prompt to hostname Ho can I make this prompt red ? thanks, -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
On Sunday 31 May 2020 at 15:44:46, Fourhundred Thecat wrote:> Hello, > > how can I change the color of the asterisk prompt to red ? > > I read in the wiki that I can use %Cn[;n] > > https://wiki.asterisk.org/wiki/display/AST/Asterisk+CLI+Configuration"The CLI prompt is set with the ASTERISK_PROMPT UNIX environment variable that you set from the Unix shell before starting Asterisk."> I currently have this in my environment: > > export ASTERISK_PROMPT="[%H]: " > > which changes the prompt to hostname > > Ho can I make this prompt red ?"%Cn[;n] - Change terminal foreground (and optional background) color to specified A full list of colors may be found in include/asterisk/term.h" So, try: export ASTERISK_PROMPT="%C31[%H]: " (I got 31 from reading the term.h file.) Regards, Antony. -- "It would appear we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements; they tend to sound pretty silly in five years." - John von Neumann (1949) Please reply to the list; please *don't* CC me.
> On 2020-05-31 15:59, Antony Stone wrote: > On Sunday 31 May 2020 at 15:44:46, Fourhundred Thecat wrote: > > "%Cn[;n] - Change terminal foreground (and optional background) color to > specified A full list of colors may be found in include/asterisk/term.h" > > So, try: > > export ASTERISK_PROMPT="%C31[%H]: " > > (I got 31 from reading the term.h file.)thanks, but that does not work for me. When I use your example: export ASTERISK_PROMPT="%C31[%H]: " I get this prompt (voip is my hostname): [1;31m[voip]: [1;0m
I work from a similar setup. I ssh'ed to my personal PBX from an xterm window on an Ubuntu 16 workstation, your prompt seems to work: *Jeff LaCoursiere* STRATUSTALK, INC. / CTO Phone: *+1 703.496.4990 x108* Mobile: *+1 815.546.6599* Email: *jeff at stratustalk.com* <mailto:jeff at stratustalk.com> Website: *https://www.stratustalk.com* Address: *One Freedom Square 13th Floor Reston, VA 20190* <https://www.facebook.com/jeff.lacoursiere> <https://linkedin.com/in/jeff-lacoursiere-884361> <https://www.twitter.com/stratustalk> On 5/31/20 8:59 AM, Antony Stone wrote:> On Sunday 31 May 2020 at 15:44:46, Fourhundred Thecat wrote: > >> Hello, >> >> how can I change the color of the asterisk prompt to red ? >> >> I read in the wiki that I can use %Cn[;n] >> >> https://wiki.asterisk.org/wiki/display/AST/Asterisk+CLI+Configuration > "The CLI prompt is set with the ASTERISK_PROMPT UNIX environment variable that > you set from the Unix shell before starting Asterisk." > >> I currently have this in my environment: >> >> export ASTERISK_PROMPT="[%H]: " >> >> which changes the prompt to hostname >> >> Ho can I make this prompt red ? > "%Cn[;n] - Change terminal foreground (and optional background) color to > specified A full list of colors may be found in include/asterisk/term.h" > > So, try: > > export ASTERISK_PROMPT="%C31[%H]: " > > (I got 31 from reading the term.h file.) > > > Regards, > > > Antony. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200531/17f7460b/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: clmgfiekdgigdkib.png Type: image/png Size: 88609 bytes Desc: not available URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200531/17f7460b/attachment-0001.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: jeff.vcf Type: text/x-vcard Size: 321 bytes Desc: not available URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200531/17f7460b/attachment-0001.vcf>
> On 2020-05-31 15:59, Antony Stone wrote: > On Sunday 31 May 2020 at 15:44:46, Fourhundred Thecat wrote: > > So, try: > > export ASTERISK_PROMPT="%C31[%H]: "does this work for you? Did you test it on your side? It color prompt works for anybody, could you please post a working example? Or is this a fictional functionality that actually does not work ?