Created
May 19, 2014 07:22
-
-
Save abhi1010/8eed9133ed91cbb42854 to your computer and use it in GitHub Desktop.
Modify Putty Window Title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"' | |
#Long Version of Putty Title | |
#PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' | |
# Modify the title of the Putty window on your windows env | |
function title | |
{ | |
if [ "$TERM" == "xterm" ] ; then | |
# Remove the old title string in the PS1, if one is already set. | |
PS1=`echo $PS1 | sed -r 's/^\\\\\[.+\\\\\]//g'` | |
export PS1="\[\033]0;$* - \u@\h:\w\007\]$PS1 " | |
export PROMPT_COMMAND='' # Make sure the title doesn't change anymore | |
else | |
echo "You are not working in xterm. I cannot set the title." | |
fi | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment