Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sorja/6b96f40c2a6989a9e4382bf1ae86aaf5 to your computer and use it in GitHub Desktop.
Save sorja/6b96f40c2a6989a9e4382bf1ae86aaf5 to your computer and use it in GitHub Desktop.
Set the iTerm tab title to the current directory, not full path.
if [ $ITERM_SESSION_ID ]; then
DISABLE_AUTO_TITLE="true"
echo -ne "\033];${PWD##*/}\007"
fi
precmd() {
echo -ne "\033];${PWD##*/}\007"
}
@sorja
Copy link
Author

sorja commented Jul 15, 2018

Updated. Previous revision caused problems if had something in PROMPT_COMMAND & don't think best idea to append there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment