Created
May 3, 2015 15:45
-
-
Save elchingon/c615b194a6a28481f22b to your computer and use it in GitHub Desktop.
Bash Profile Tab Naming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tabname { | |
# Will use current dir name if called without arg. | |
printf "\e]1;${1-$(basename `pwd`)}\a" | |
} | |
function winname { | |
# Will use current dir name if called without arg. | |
printf "\e]2;${1-$(basename `pwd`)}\a" | |
} | |
function tab { | |
# Will cd into current dir if called without arg. | |
osascript -e 'tell application "Terminal"' \ | |
-e 'tell application "System Events" to keystroke "t" using {command down}' \ | |
-e "do script \"cd `pwd` && cd ${1-.} && tabname && clear\" in front window" \ | |
-e 'end tell' > /dev/null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment