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

Ringger81
  • 1,397
  • 3
  • 13
  • 28

2 Answers2

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

TheCompWiz
  • 10,912
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"
TheCompWiz
  • 10,912