Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hostnames with putty 1

Status
Not open for further replies.

jouell

MIS
Nov 19, 2002
304
US
If I use putty to ssh into boxA, and from boxA ssh into boxB, how do I get putty to display boxB in the title?

Thanks
-John
 
I use this little script:

Code:
#!/bin/ksh
#
# Change the title of an xterm window.
print -n "^[]0;${*}^G"

NB: ^[ and ^G are control characters, you will need to enter them in vi using Ctrl-V Esc and Ctrl-V Ctrl-G respectively.

I call it from my .profile with these parameters:

Code:
scriptname "`/bin/hostname` - `tty`"


Annihilannic.
 
Try the latest version of putty - my version (0.52) does this automatically

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thanks guys.

I have the latest version yet, the title is not updating properly. I've got 0.58 Putty on XP SP2.

However,Annihilannic's script works awesome, although i really have no idea how it's working its magic.


THANKS!!!!
-John
 
[tt]^[]0;somestring^G[/tt] is the standard terminal control code to change an xterm title, and since PuTTY uses xterm style emulation it works for PuTTY too.

Normally you would use something like [tt]`tput cap`somestring^G[/tt] or similar for portability where "cap" is the capability name. This would make it read the capability from the terminfo database and use the correct control code for the current terminal type, or none at all if it doesn't support that feature.

Unfortunately I've never been able to find the terminfo capability name for changing the window title, so I'm stuck with the manual method.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top