I want to change the title of the gnome-terminal window to reflect the current directory. Is there a way to do that? A script may be? The \"change terminal title\" threads did n
I'm doing it like this to override the cd
command and set pwd
into the title:
function title { echo -en "\033]2;$1\007"; }
function cd { dir=$1; if [ -z "$dir" ]; then dir=~; fi; builtin cd "$dir" && title `pwd`; }
cd `pwd`
I just threw this into my ~/.bash_aliases
. You could probably tweak this to do what you want.