[j-nsp] Does Junos cli support colors?

Martin T m4rtntns at gmail.com
Thu Mar 15 11:44:37 EDT 2018


Hi!

When I start an ash shell and use terminal escape codes, then string
"Hello" is printed in red as expected:

user at vMX> start shell sh
$ echo $TERM
screen
$ echo -e "\e[31mHello\e[0m"
Hello
$

Is it possible to print colors in Junos cli? My cli terminal type is
also "screen" according to "show cli" command. I tried with few
jcs:output functions like:

expr jcs:output("\\\e[31mHello\\\e[0m\s");
expr jcs:output("\e[31mHello\e[0m");

..and with <output> elements like:

<output> "\\\e[31mHello\\\e[0m";
<output> '"\\\e[31mHello\\\e[0m"';


I guess it is not possible to use colors in SLAX scripts?


thanks,
Martin


More information about the juniper-nsp mailing list