I've found tons of places that describe how to get the window title and tab titles to reflect the current directory (relative to my home directory).

Here is what is in my .zshrc:

precmd() {
  # sets the tab title to current dir
  CURRENT=$(print -P %3~)
  echo -ne "\e]1;~/${CURRENT##*/}\a"

Works like a charm when I cd around. However, when I run a command-- rails console, for example--that process name replaces the current directory information in both my window and tabs titles. This is unhelpful as I've got lots of tabs open, several in different directories (which represent different rails applications)and don't really care what process is running as much as where I am.

Is there a way to configure either iterm2 or zsh to NOT change the titles to the current process name?


  • I figured it out: in my .zshrc I uncommented DISABLE_AUTO_TITLE="true"
    – jaydel
    Commented Jun 7, 2016 at 14:37

1 Answer 1


In my .zshrc I uncommented the line:


This keeps the process from being put into the title because it's not changing the title automatically. The precmd function is called regardless of this setting so in there I change the titles manually.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .