Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Set the title of the Terminal window with cd' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set the title of the Terminal window with cd
Authored by: jacobolus on May 04, '06 02:24:04PM
Why not just change the titlebar in your prompt? I use:
titlebar='\[\e]2;local: \w\a'
blue='\e[0;34m'
red='\e[0;31m'
NC='\e[0m'
export PS1="\[${titlebar}${blue}\]local: \w \[${red}\]\$\[${NC}\]"
But to set it up somewhat similar to this hint, try:
titlebar='\[\e]2;\w\a\e]1'
export PS1="\[${titlebar}\]\h:\u\$ "
Then it will get executed every time the prompt shows up. Much better than making odd custom cd commands.

[ Reply to This | # ]
Set the title of the Terminal window with cd
Authored by: jacobolus on May 04, '06 02:56:55PM
Note: you want to put those lines in your ~/.bashrc

[ Reply to This | # ]