Skip to content

Instantly share code, notes, and snippets.

@savage69kr
Forked from samsonjs/some.sh
Created October 27, 2012 07:14
Show Gist options
  • Select an option

  • Save savage69kr/3963290 to your computer and use it in GitHub Desktop.

Select an option

Save savage69kr/3963290 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