Skip to content

Instantly share code, notes, and snippets.

@shenie
Created January 27, 2010 06:01
Show Gist options
  • Save shenie/287572 to your computer and use it in GitHub Desktop.
Save shenie/287572 to your computer and use it in GitHub Desktop.
tab-fu

This script will open a new Terminal tab at the current directory or another directory relative to the current directory. Assuming tab.sh is somewhere in your PATH. For example I saved it in my ~/bin then you can just do:

tab.sh
tab.sh ../another_project
#!/bin/bash
current=$(pwd)
destination=${current}/${1}
osascript 2>/dev/null <<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
do script with command "cd $destination" in window 1
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment