putty title window?

I have implemented the solution from mschwage located in post Change putty title window?; ie

wt ()
{
echo -n "^[]2;${@}^G"
}

This method is awesome!!!!

The reason I am sending you this message is to get your assistance with another issue I am runing into in respect to the window title.

This issue is - after putty'ng to system (A) the title changes appropriately... while logged into system (A) I run "ssh user@B" via the command line. This now changes the title to system (B). So far everything works as expected, until I exit system (B). The result is the the window title still reflects system system (B).

How do I get the window title to change back to system (A) on exiting system (B)? I'd like this to be automated.

Thanks!!!!

You'll have to create an alias called 'ssh' to a wrapper script for ssh so that you can execute your bit of code after ssh exits.

Smiling Dragon, thanks for this information. How would I create a wrapper script... is this just a regular script my ssh program calls?

Yep, just a regular script, something like the following:

#!/bin/sh
/path/to/ssh $*
echo -n "^[]2;${@}^G"

Edit: It calls ssh, rather than the other way round - it 'wraps' around ssh, thus the name.