Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use PROMPT_COMMAND to set titles on iTerm tabs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use PROMPT_COMMAND to set titles on iTerm tabs
Authored by: MordEth on Jan 29, '04 07:47:03AM

i can't believe anyone hasn't already posted this, but $PROMPT_COMMAND is not specific to iTerm (works in X-windows, as well as Apple's Terminal in 10.3), nor is it the same thing as $PS1.

$PS1 is the prompt that you have, whereas $PROMPT_COMMAND is the window title. they are not interchangeable. personally, i'm glad Apple finally decided to implement this in 10.3, as i really like titling my windows with $PROMPT_COMMAND and the keyboard shortcut to activate that window (i.e. Cmd-1, 2, etc.)



[ Reply to This | # ]
Use PROMPT_COMMAND to set titles on iTerm tabs
Authored by: corti on Nov 29, '04 05:05:46PM

Just to point out that the PROMPT_COMMAND variable does not set the windows title. It is a command that is executed before before issuing a prompt.

In the original hint the PROMPT_COMMAND contains an echo command which is the command actually changing the title.

You can use PROMPT_COMMAND to do whatever you want. An example could be to print out the date before the prompt:
export PROMPT_COMMAND=date

Matteo



[ Reply to This | # ]