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 not an expert but you should try to edit your ~/.bashrc file. If I understood your problem correctly you can change your .bashrc according to my (I'm using Ubuntu 12.04). The "old" line is commented out and the new one is below it (with additional comment).
case "$TERM" in
xterm*|rxvt*)
# OLD PS1 directive
#PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# NEW PS1 directive, shows only current directory name as terminal window name
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\W\a\]$PS1"
;;
*)
;;
esac
The result is that my terminal title is equal to my current directory title eg.
after cd Documents/projects
my terminal title is projects
(if file is open the terminal name is its name)