Skip to content

Instantly share code, notes, and snippets.

@entryway
Forked from jnunemaker/instructions.txt
Created June 5, 2009 18:16
Show Gist options
  • Save entryway/124408 to your computer and use it in GitHub Desktop.
Save entryway/124408 to your computer and use it in GitHub Desktop.
1) Put terminal_clone_tab.sh somewhere in
your path and make sure it is executable
chmod u+x terminal_clone_tab.sh
2) Then add the following alias (~/.bash_profile or something)
alias nt='terminal_clone_tab.sh'
3) Then you can hit nt (for new tab) anywhere
and a new tab will open up in same directory.
If there is an easier way to do this, let me know nunemaker@gmail.com.
#!/bin/sh
osascript <<-eof
tell application "Terminal"
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
do script with command "cd `pwd`; clear" in selected tab of the front window
end tell
eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment