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: fresler on May 04, '06 07:43:28AM

After reading this hint, I went to my terminal and discovered that the path was already in the title bar. However, I had never done this hint or the other two mentioned. I then discovered that during local access, the title bar didn't change as I changed directories. However, if I SSHed into a remove server, the title bar changed to the user I was logged in as and the current directory. It looks somethink like this: "username@server:/home - ssh - 100x31". I'm not sure if this the default behavior of the terminal or if I applied some other hint I ran across. If I did, I sure can't remember it!



[ Reply to This | # ]
Set the title of the Terminal window with cd
Authored by: enderai on May 04, '06 09:58:06AM

I noticed this too one day. Look at your .bashrc on the remote server, and you'll find some commands that set the window title of an xterm session to user@localhost:/path. Well, when Terminal.app is set to emulate an xterm session, it picks up the window title change, too. The same code works if you copy it into your .bash_profile or .bashrc file on your Mac.



[ Reply to This | # ]
Set the title of the Terminal window with cd
Authored by: denny on May 04, '06 07:41:12PM

PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w) '


I use this line in my .bash_login file. Have used that for years and it works pretty nicely for me.



[ Reply to This | # ]