Skip to content

Instantly share code, notes, and snippets.

@mvoropaiev
Created January 21, 2018 17:41
Show Gist options
  • Save mvoropaiev/bf6b698603d0ec47682e1ec65d752b64 to your computer and use it in GitHub Desktop.
Save mvoropaiev/bf6b698603d0ec47682e1ec65d752b64 to your computer and use it in GitHub Desktop.
# iterm2 shell integration is required
it2toucbar_status() {
msg="${PWD##*/}"
branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
[[ -n "$branch" ]] && msg+=": $branch"
echo "$msg"
}
[[ $PROMPT_COMMAND != *"it2toucbar_status"* ]] && PROMPT_COMMAND+='it2setkeylabel set status "$(it2toucbar_status)"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment