Skip to content

Instantly share code, notes, and snippets.

@hongjiang
Created January 23, 2015 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongjiang/2fe85e152d942c7f73ab to your computer and use it in GitHub Desktop.
Save hongjiang/2fe85e152d942c7f73ab to your computer and use it in GitHub Desktop.
call mac osascript open a new Terminal.app
newTerminal(){
osascript 2>/dev/null <<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
activate
do script with command "cd $PWD" in window 1
do script with command "$*" in window 1
end tell
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment