Setting the title of PuTTY window.

2010-02-04 103 words 1 min read

Setting the title for PuTTY window is quite a simple trick. The trick is to set the PS1 with a escape sequence. When the PS1 is set with the escape sequence the variable will set the title window also. And not only can this trick be used in PuTTY but even on gnome-terminal to set the title dynamically. You can use this in the .bashrc or .bash_profile file to do it whenever you are starting the terminal.

export PS1=”\[\033]0;$1 – \u@\h:\w\007\]$PS1”

Sometimes this does not work and then you can use the PROMPT_COMMAND to do this:

export PROMPT_COMMAND=’echo -ne ”\033]0;`pwd`”; echo -ne ”\007”’

Related Articles:


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it