Last active
December 11, 2019 05:43
-
-
Save eddieh/8aeecf8b6bca477502a16d9ab5f6b031 to your computer and use it in GitHub Desktop.
Name tabs based on the current directory in Terminal.app
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
# set the current tab's name | |
function tab_name { | |
printf "\e]1;$1\a" | |
} | |
# set the tab's name to the current working directory name | |
function update_tab_name { | |
tab_name "$(basename $PWD)" | |
} | |
# do this before printing a prompt | |
export PROMPT_COMMAND="update_terminal_cwd; update_tab_name;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment