Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2289  / 3 Years ago, thu, september 30, 2021, 6:26:46

I have several servers that have the same prefix in their name: mail.servername. When I have several sessions open (I use PuTTY from Windows 7), it is a minor PITA to figure out which one is which since PuTTY names the windows user@mail and the command line displays user@mail:~$ for all of them.



Is there a way to have the full server name displayed? I don't have the option of changing the servers' names.


More From » 12.04

 Answers
3

Think what you are looking for for changing the PuTTY window title is this: PuTTY allows the server to send xterm control sequences which modify the title of the window in mid-session. From the putty manual.



How to actually do it, point your favorite text editor to ~/.bashrc
Locate the lines that say:



case "$TERM" in
xterm*|rxvt*)
PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"


Then change:



PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w$'


to:



PS1='[e]0;u@YOUR MODIFIED TINGY: wa]${debian_chroot:+($debian_chroot)}u@h:w$'


Save and be happy. If you wanna test it before doing the final change, use export PS1='all the stuff'


[#28235] Thursday, September 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
looweets

Total Points: 52
Total Questions: 114
Total Answers: 111

Location: Turkmenistan
Member since Sat, Apr 16, 2022
2 Years ago
;