I want to label the window tabs of terminal sessions. I'm using the zshell in iterm2 on OSX. Is it possible to change the label of a window tab dynamically in the terminal?
iTerm2 – How to Change Window and Tab Titles in Zsh
command lineitermosx-snow-leopardzsh
Best Answer
You can enter the following in
zsh
to set the window title of iTerm2:If you want to automate that to insert e.g. the current time or working directory, edit your
zsh
configuration files to set the title in theprecmd()
function to e.g.$PWD
.You can read about the
precmd
function inman zshmisc
in the sectionSPECIAL FUNCTIONS
.