-1

I' using Putty client to connect to ssh server running on Virtualbox Linux machine. I'm trying to change the prompt color by setting the PS1 variable like so:

export PS1="\u@\h:\e[0;1m\w\$\e[m"

but it's apparently not working - the prompt is still the same color. When i type the command directly on my Virtualbox Linux machine it does work. Moreover i've noticed that also changing the TERM variable doesn't has an effect when running in Putty.

1

2 Answers 2

0

Try setting the terminal-type string prior to connecting.

Setting the "xterm-color" type lets bash (and others) know that your tty supports color.

You can also do some fun things with the environment variables... but that is another discussion for another day.

putty config window

1
  • Setting the terminal-type doesn't help either. I can't set the color like on native Linux console.
    – Ringger81
    Jan 25, 2018 at 18:44
0

... it looks like your color choices don't exist.

Black        0;30     Dark Gray     1;30
Red          0;31     Light Red     1;31
Green        0;32     Light Green   1;32
Brown/Orange 0;33     Yellow        1;33
Blue         0;34     Light Blue    1;34
Purple       0;35     Light Purple  1;35
Cyan         0;36     Light Cyan    1;36
Light Gray   0;37     White         1;37

Perhaps you meant something more like this for red:

export PS1="\u@\h:\e[0;31m\w\$\e[00m"
3
  • Yes, when i use one of this it works but It's still strange since 2;2 DOES works when on native, non ssh (VirtualBox) console. It produces just light blue color.
    – Ringger81
    Jan 25, 2018 at 23:21
  • Can You answer my last question?
    – Ringger81
    Jan 26, 2018 at 10:49
  • I honestly have no clue what 2;2 is talking about. Could you provide a complete prompt-string including what you're talking about?
    – TheCompWiz
    Feb 7, 2018 at 21:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .