-
-
Save adamhunter/159895 to your computer and use it in GitHub Desktop.
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) Add the function below into your .bash_profile, .bash_login, or other shell profile file. | |
2) Then you can hit nt (for new tab) anywhere | |
and a new tab will open up in same directory. | |
All credit for the idea and applescript goes to @jnunemaker - I just tidied it up. | |
If you can improve it further, let him 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
function nt { | |
terminal_clone_command=" | |
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 | |
" | |
echo "$terminal_clone_command" | osascript &>/dev/null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment