Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat

> On 2020-05-31 19:26, Jeff LaCoursiere wrote:

Hi,

I really don't know why yours doesn't work.  Perhaps you can tell us
what your terminal emulator is, what you are running it on, etc.
Whatever it is, it isn't properly interpreting the escape codes for
xterm-256color.  You could possibly try some different terminal types,
but this is an odd situation if the remote shell (is it remote?) can't
determine your termtype.  This is pretty ancient code.


my terminal emulator is terminator, I also tried xterm (same result)

and echo $TERM gives me:
xterm-256color

My system is Debian Buster, but not sure if that is relevant

what terminal emulator are you using ?

--
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Jeff LaCoursiere

Hi,

I had posted this a few hours ago, but got caught in moderation for 
size.  I trimmed down the pic and attached.


I am on an Ubuntu 16 workstation, in an Ubuntu terminal window, ssh'ed 
to the PBX (amazon instance).  You can see my term type matches yours.


I really don't know why yours doesn't work.  Perhaps you can tell us 
what your terminal emulator is, what you are running it on, etc.  
Whatever it is, it isn't properly interpreting the escape codes for 
xterm-256color.  You could possibly try some different terminal types, 
but this is an odd situation if the remote shell (is it remote?) can't 
determine your termtype.  This is pretty ancient code.


j


*Jeff LaCoursiere*
STRATUSTALK, INC. / CTO

Phone:  *+1 703.496.4990 x108*
Mobile: *+1 815.546.6599*
Email:  *j...@stratustalk.com* 
Website:*https://www.stratustalk.com*
Address:*One Freedom Square
13th Floor
Reston, VA 20190*

 
 



On 5/31/20 11:42 AM, Fourhundred Thecat wrote:

On 2020-05-31 18:39, Ira wrote:

I typed this at the terminal prompt:  export ASTERISK_PROMPT="%C31[%H]: "

Typing at the same place:  echo $TERM  returns xterm

And now I have colored prompts at the Asterisk command line, so I can
assure you it can work. Kind of cool, 14 years using Asterisk and
because of your question, I now have colored prompts.

Do I have to do something to make sure that ASTERISK_PROMPT lives
through a reboot?

I would add the export to .bashrc/.zshrc or whatever shell you are using

why does it not work for me?
My terminal clearly supports 256 colors.

<>-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat
> On 2020-05-31 18:39, Ira wrote:
>
> I typed this at the terminal prompt:  export ASTERISK_PROMPT="%C31[%H]: "
>
> Typing at the same place:  echo $TERM  returns xterm
>
> And now I have colored prompts at the Asterisk command line, so I can
> assure you it can work. Kind of cool, 14 years using Asterisk and
> because of your question, I now have colored prompts.
>
> Do I have to do something to make sure that ASTERISK_PROMPT lives
> through a reboot?

I would add the export to .bashrc/.zshrc or whatever shell you are using

why does it not work for me?
My terminal clearly supports 256 colors.

-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Ira
Hello Fourhundred,

Sunday, May 31, 2020, 9:04:10 AM, you wrote:

Fourhundred> Did you test it on your side?

Fourhundred> It color prompt works for anybody, could you please post a working 
example?

Fourhundred> Or is this a fictional functionality that actually does not work ?


I typed this at the terminal prompt:  export ASTERISK_PROMPT="%C31[%H]: "

Typing at the same place:  echo $TERM  returns xterm

And now I have colored prompts at the Asterisk command line, so I can
assure you it can work. Kind of cool, 14 years using Asterisk and
because of your question, I now have colored prompts.

Do I have to do something to make sure that ASTERISK_PROMPT lives
through a reboot?

-- Ira 


-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat
> 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 ?


-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat
> On 2020-05-31 16:59, Telium Technical Support wrote:
> That means that Asterisk is not echoing the escape character (27) to your 
> terminal.
>
> Try different escape formats (octal, slash prefix, etc)

can somebody please provide working example ?

What exactly to I have to export?


-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Telium Technical Support
That means that Asterisk is not echoing the escape character (27) to your 
terminal.

Try different escape formats (octal, slash prefix, etc)

-Original Message-
From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf 
Of Fourhundred Thecat
Sent: Sunday, May 31, 2020 10:31 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion 

Subject: Re: [asterisk-users] CLI color prompt

 > On 2020-05-31 16:25, Jeff LaCoursiere wrote:
> I'm pretty sure that means your are using a non-color capable 
> terminal, or your termtype variable is incorrect.  What are you using 
> for a terminal emulator?

my terminal supports colors, I am using colored prompt in bash/zsh already. I 
made a screenshot:

https://paste.pics/d1eb46bac0a8d06d645230225191615e


--
_
-- 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


-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat

> On 2020-05-31 16:25, Jeff LaCoursiere wrote:

I'm pretty sure that means your are using a non-color capable terminal,
or your termtype variable is incorrect.  What are you using for a
terminal emulator?


my terminal supports colors, I am using colored prompt in bash/zsh
already. I made a screenshot:

https://paste.pics/d1eb46bac0a8d06d645230225191615e


--
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat

> On 2020-05-31 16:24, Antony Stone wrote:

On Sunday 31 May 2020 at 16:03:07, Fourhundred Thecat wrote:


export ASTERISK_PROMPT="%C31[%H]: "

I get this prompt (voip is my hostname):

[1;31m[voip]: [1;0m


In that case I suspect you're using a terminal which doesn't support colours.

If "echo $TERM" tells you any sort of "xterm", "vt100", "crt" or "dumb" then
you won't get colour.


my terminal definitely supports colors. I am using colored prompt in
bash/zsh.

echo $TERM gives me:
xterm-256color


--
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Jeff LaCoursiere
I'm pretty sure that means your are using a non-color capable terminal, 
or your termtype variable is incorrect.  What are you using for a 
terminal emulator?


*Jeff LaCoursiere*
STRATUSTALK, INC. / CTO

Phone:  *+1 703.496.4990 x108*
Mobile: *+1 815.546.6599*
Email:  *j...@stratustalk.com* 
Website:*https://www.stratustalk.com*
Address:*One Freedom Square
13th Floor
Reston, VA 20190*

 
 



On 5/31/20 9:03 AM, Fourhundred Thecat wrote:

> 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

<>-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Antony Stone
On Sunday 31 May 2020 at 16:03:07, Fourhundred Thecat wrote:

> export ASTERISK_PROMPT="%C31[%H]: "
> 
> I get this prompt (voip is my hostname):
> 
> [1;31m[voip]: [1;0m

In that case I suspect you're using a terminal which doesn't support colours.

If "echo $TERM" tells you any sort of "xterm", "vt100", "crt" or "dumb" then 
you won't get colour.


Regards,


Antony.

-- 
Late in 1972 President Richard Nixon announced that the rate of increase of 
inflation was decreasing.   This was the first time a sitting president used a 
third derivative to advance his case for re-election.

 - Hugo Rossi, Notices of the American Mathematical Society

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat

> 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

--
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Antony Stone
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.

-- 
_
-- 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

Re: [asterisk-users] CLI color prompt

2020-05-31 Thread Telium Technical Support
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-boun...@lists.digium.com] On Behalf 
Of Fourhundred Thecat
Sent: Sunday, May 31, 2020 9:45 AM
To: asterisk-users@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


-- 
_
-- 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

[asterisk-users] CLI color prompt

2020-05-31 Thread Fourhundred Thecat

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