Skip to content

Instantly share code, notes, and snippets.

View floxx's full-sized avatar
🐰

Florian Busch floxx

🐰
View GitHub Profile
@floxx
floxx / gist:fee2f89edbbbbbc08e65
Last active March 11, 2016 10:24 — forked from davidmh/gist:6228319
iTerm Tab & Window Titles with zsh and git.original: http://timbabwe.com/2012/05/iterm_tab_and_window_titles_with_zsh
function precmd() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
window_label=$(git rev-parse --show-toplevel)
tab_label=$(echo $window_label | awk -F\/ '{print "git:" $NF}')
else
window_label=${PWD/${HOME}/\~}
tab_label=$window_label
fi
echo -ne "\e]2;${window_label}\a"
echo -ne "\e]1;${tab_label: -100}\a"