OS X Tip: Opening a new terminal tab in the current location
3 years agoThis is extremely useful while programming. Your
pwdis /really/long/path/to/some/folder and you want to open a new tab in the OS X Terminal and navigate to the same folder. You can automate this thanks to AppleScript.Save the following script in a file named
~/scripts/newtab.scpt:on run argv tell application "System Events" to tell process "Terminal" to keystroke "t" using command down tell application "Terminal" to do script "cd " & item 1 of argv in front window end runThen in your
~/.bashrcor~/.bash_profile, add the following:alias newtab='osascript ~/scripts/newtab.scpt `pwd`'Credits: I found this solution here.