Current path in Terminal title
Posted on September 9th, 1997 by shacker
You can have the title bar of your Terminal session always report the current working directory. For example, if the current directory is /boot/home/Words, it will say that in the Terminal session’s title tab. Just add the following function to your /boot/home/.profile
:
function path_title() { echo -en "33]2;`pwd`07" } PROMPT_COMMAND=path_title
Open a new Terminal and try cd’ing around to see how it works.
Peter Folk (pfolk@gargtech.com) adds: The command from this tip wasn’t correctly quoted, so it didn’t make it through the HTML system. The correct command is below:
echo -en '\\033]2;TextInTitle\\007'