Forked from phette23/current-dir-in-iterm-tab-title.sh
Last active
May 7, 2018 19:54
-
-
Save kpman/fdfa9093acef93894d12a157d9a672ec to your computer and use it in GitHub Desktop.
Set the iTerm tab title to the current directory, not full path.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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