iTerm2 Tab Before:
iTerm2 Tab Before

iTerm2 Tab After:
iTerm2 Tab After

Add this in the ~/.bash_profile

if [ $ITERM_SESSION_ID ]; then
  export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi

Activate it: source ~/.bash_profile

Added bonus

Right click on the iTerm2 icon shows a list of active terminal. I rely on that while working with multiple terminal windows. Having a properly named list by session location is a great productivity boost.

iTerm2 Windows List Before:
iTerm2 Windows List Before

iTerm2 Windows List After:
iTerm2 Windows List After


Published

Category

macos

Tags

Contact