-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,097
  • 3
  • 11
  • 22
  • Possible duplicate of https://superuser.com/questions/198452/how-do-i-change-the-colour-scheme-on-putty . Also, consider using mtputty to save multiple sessions' settings. – Christopher Hostage Jan 25 '18 at 17:57

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,602
  • 1
  • 23
  • 21
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,602
  • 1
  • 23
  • 21
  • 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 '18 at 23:21
  • Can You answer my last question? – Ringger81 Jan 26 '18 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 07 '18 at 21:24