Created
June 5, 2009 18:06
-
-
Save jnunemaker/124402 to your computer and use it in GitHub Desktop.
How to open a clone of the current tab in terminal with a simple 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
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 [email protected]. |
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
#!/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