Skip to content

Instantly share code, notes, and snippets.

@samsonjs
Forked from tj/some.sh
Created October 12, 2012 05:13
Show Gist options
  • Save samsonjs/3877451 to your computer and use it in GitHub Desktop.
Save samsonjs/3877451 to your computer and use it in GitHub Desktop.
change terminal tab name on cd
tabname() {
printf "\e]1;$1\a"
}
cd() {
if [[ $# -gt 0 ]]; then
builtin cd "$*"
else
builtin cd
fi
tabname $(basename $(pwd))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment