Skip to content

Instantly share code, notes, and snippets.

@nruth
Created July 18, 2010 20:25
Show Gist options
  • Save nruth/480680 to your computer and use it in GitHub Desktop.
Save nruth/480680 to your computer and use it in GitHub Desktop.
OSX open new terminal tab @ current pwd
#!/usr/bin/env ruby
require 'fileutils'
extend FileUtils
cmd1 = "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down"
cmd2 = "tell application \"Terminal\" to do script \"cd #{pwd}\" in the front window"
`osascript -e '#{cmd1}' -e '#{cmd2}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment