Terminal titles, KDE, Gnome etc...
Just an informational sort of question here:
Does anyone know how the current working dir is displayed at the top of the terminal window in some terminal applications ? I know that it can be done with $PS1 at the prompt in bash but how is it constantly updated and sent to the terminal app ? is some variable set to $pwd and updated with each call of cd ? I'm curious because I've been playing with aterm and eterm on my mac and linux boxes and was sondering how to get these apps to display a similar window title. Thanks |
Set the environment variable $PROMPT_COMMAND. In my ~/.bashrc (which is sourced from .bash_profile so it's always set) I have this:
Code:
# Change the window title of X terminals Håkan |
Thanks that worked great!
So its actually written into the various terminal apps to call that variable each time the directory changes and update the title bar accordingly ? Thanks again. |
Yes, it is called each time. From `info bash':
PROMPT_COMMAND If set, the value is executed as a command prior to issuing each primary prompt. Alternatively, you can use a bash function `nameTerminal' like this: Code:
# Set terminal title Freddy Vulto http://fvue.nl |
All times are GMT -5. The time now is 07:33 PM. |