05-17-2022 05:16 AM - edited 05-17-2022 05:20 AM
Hey.
I'm trying to change NSO CLI prompt colour. I'm using this thread as help: https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
In my linux shell this prints following text green:
printf '\033[32m'
echo $TERM prints 'xterm'
I tried the following in ncs.conf (ncs --reload applied):
<cli> <c-prompt1>\033[32m\u@ncs#\033[0m </c-prompt1> <c-prompt2>\[\033[32m\]\u@ncs(\m)#\[\033[m\] </c-prompt2> </cli>
Nothing, CLI prints 033[ and stuff instead of colours. I tried with 'e' instead of '033' too. No music.
Tail-f, please help
05-17-2022 06:15 AM
05-17-2022 07:40 AM
I don't have such luck:
I used your example, the user and hostname flags work, but colour stuff not.
This is on Windows Terminal, I tried with putty just in case, to same result.
05-17-2022 08:22 AM
It works in the CLI, which is where I always do it:
Not sure if you need to do something special in ncs.conf.
05-17-2022 09:25 AM - edited 05-17-2022 09:41 AM
That was it, I was setting it up in ncs.conf and it just doesn't want to work.
How do I persist the prompt change done via CLI though?
05-17-2022 12:01 PM
05-23-2022 10:18 PM - edited 05-23-2022 10:19 PM
I tried combinations of what I found as an example in man pages:
<prompt1>\[]0;\u@\h\]\u@\h> </prompt1>
This this particular expression works. When I tried to apply it for colour coding it doesn't. Either because I might be misreading the example or because it simply doesn't want to do colours.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide