Skip to content

Instantly share code, notes, and snippets.

@JC1738
Created December 23, 2015 18:18
Show Gist options
  • Save JC1738/f15c8f70a7d448f91510 to your computer and use it in GitHub Desktop.
Save JC1738/f15c8f70a7d448f91510 to your computer and use it in GitHub Desktop.
open new tmux session on new tab in iterm2
#!/usr/bin/env osascript
on run argv
set AppleScript's text item delimiters to {" "}
set newpath to "cd " & argv
set tmuxstring to "tmux attach -t base || tmux new -s base"
tell application "iTerm"
make new terminal
tell the current terminal
activate current session
launch session "Default Session"
tell the last session
write text newpath as string
end tell
tell the last session
write text tmuxstring as string
end tell
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment