Skip to content

Instantly share code, notes, and snippets.

@chrisfsmith
Last active August 29, 2015 14:01
Show Gist options
  • Save chrisfsmith/863b60bf443a718886b8 to your computer and use it in GitHub Desktop.
Save chrisfsmith/863b60bf443a718886b8 to your computer and use it in GitHub Desktop.
Tab title shows git repo name
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