Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kpman/fdfa9093acef93894d12a157d9a672ec to your computer and use it in GitHub Desktop.
Save kpman/fdfa9093acef93894d12a157d9a672ec to your computer and use it in GitHub Desktop.
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
###########################
# ~/.zshrc
precmd() {
# sets the tab title to current dir
echo -ne "\e]1;${PWD##*/}\a"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment