How can I get the Terminal.app in OS X to display the current directory in its window or tab title?
I'm using the bash shell.
|
1
|
How can I get the Terminal.app in OS X to display the current directory in its window or tab title? I'm using the bash shell. |
|||
|
|
|
|
Depends on your shell. This article displays multiple methods. I personally use zsh which has a convenient precmd() function which is run before each prompt.
Although the other questions list bash methods, they alias cd. Bash provides an inherent method that chains off just the prompt.
|
||||||
|
|
|
Enter this into your ~/.profile or equivalent file:
The first line contains two special characters that can't be copied/pasted, but you can download the text from here: http://blog.nottoobadsoftware.com/files/setterminaltitle.sh. |
||
|
|