Skip to content

Instantly share code, notes, and snippets.

@chenqj
chenqj / gist:1924654
Created February 27, 2012 15:26
动态更改iTerm的tab title
##############################
# 在通过cd命令更改目录时,可动态将iTerm的tab title改为当前的目录(只取最近的目录名)
# Usage:加入到~/.bash_profile,并重新source使其生效
##############################
# change tab title
settitle() { printf '\e]0;'${@}'\a' ; return ; }
# rewrite cd
cd() { command cd "$@"; settitle $(basename $(pwd)); return ; }