The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Current path in Terminal title

Contributed by: Brad Froehle
This tip is valid for: Both BeOS and Haiku

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'

Posted in Terminal


(comments are closed).