Take the 2-minute tour ×

Normally, when you load a saved session in PuTTY and connect to it, PuTTY will set the window title to the host name of the system you connected to (plus the string "PuTTY").

Now I have many different sessions that all connect to the same host, but on different ports (because the host runs several SSH tunnels on different ports). Therefore seeing the host name is not very helpful, since it's always the same.

So I'd like PuTTY to show the name of the loaded session in the window title. Is there a way to do this?

The only way I could find is to set the window title manually (Window / Behaviour / Window title). But I believe I'd have to do this manually for each session, which is rather tedious.

share|improve this question

3 Answers 3

The solution below seems to solve this problem.


Hope this helps, Andy

share|improve this answer
While this may answer the question, it's preferable if you can summarise the answer here as links do go dead over time. –  Ladadadada May 28 at 10:43

This function will set the title of your PuTTY window to the given String

# set title 
title() {
  echo -ne "\033]0;"$1"\007"

You can use this to set the title from the command line or from scripts, e.g. from within .bashrc.

share|improve this answer

The only other route I'm aware of is to use the xterm emulation features to set the title from the system you are logged into (on RedHat and Suse linux, the bash prompt is written to the titlebar by default).

See this page for a description of the process and the relevant escape sequence.

share|improve this answer

Your Answer


