Created
May 11, 2012 22:52
-
-
Save naaman/2662936 to your computer and use it in GitHub Desktop.
Open iTerm2 Pane and Execute a Command
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
pane() { | |
local currentDir=$(pwd) | |
osascript <<EOD | |
tell application "iTerm" | |
tell application "System Events" to keystroke "d" using command down | |
tell current session of current terminal | |
write text "cd $currentDir" | |
write text "$@" | |
end tell | |
end tell | |
EOD | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment