Last active
August 29, 2015 14:01
-
-
Save chrisfsmith/863b60bf443a718886b8 to your computer and use it in GitHub Desktop.
Tab title shows git repo name
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
function tab_title() { | |
local REPO=$(basename `git rev-parse --show-toplevel 2> /dev/null` 2> /dev/null) || return | |
if [[ -z $REPO ]] | |
then | |
echo "%20<…<${PWD/#$HOME/~}%>>" # 20 char left truncated PWD | |
else | |
echo "%20>…>$REPO%>>🔹" # 20 char right truncated | |
fi | |
} | |
ZSH_THEME_TERM_TAB_TITLE_IDLE='$(tab_title)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment