Skip to content

Instantly share code, notes, and snippets.

@hcarvalhoalves
Created March 17, 2017 02:43
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 hcarvalhoalves/aead0009d369d13c634d60fd67f339b9 to your computer and use it in GitHub Desktop.
Save hcarvalhoalves/aead0009d369d13c634d60fd67f339b9 to your computer and use it in GitHub Desktop.
Shell functions to command iTerm2 via AppleScript
#!/bin/env bash
function tt() {
osascript &>/dev/null <<EOF
tell application "iTerm2"
tell current window
create tab with default profile command "$@"
end tell
end tell
EOF
}
function th() {
osascript &>/dev/null <<EOF
tell application "iTerm2"
tell current session of current window
split horizontally with default profile command "$@"
end tell
end tell
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment