Skip to content

Instantly share code, notes, and snippets.

@abhi1010
Created May 19, 2014 07:22
Show Gist options
  • Save abhi1010/8eed9133ed91cbb42854 to your computer and use it in GitHub Desktop.
Save abhi1010/8eed9133ed91cbb42854 to your computer and use it in GitHub Desktop.
Modify Putty Window Title
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