Skip to content

Instantly share code, notes, and snippets.

@marcelosomers
Created January 24, 2014 15:03
Show Gist options
  • Save marcelosomers/8598959 to your computer and use it in GitHub Desktop.
Save marcelosomers/8598959 to your computer and use it in GitHub Desktop.
Bash script to open a new terminal window in the existing window's directory
#!/bin/sh
# Stolen from stackoverflow.com/questions/1589114/opening-a-new-terminal-tab-in-osxsnow-leopard-with-the-opening-terminal-window
# Add as a file named `tup` somewhere on your $PATH (e.g., ~/bin
pwd=`pwd`
osascript -e "tell application \"Terminal\"" \
-e "tell application \"System Events\" to keystroke \"t\" using {command down}" \
-e "do script \"cd $pwd; 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