Created
January 24, 2014 15:03
-
-
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
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
#!/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