This is a nifty little trick I swiped from a Stack Overflow question.
Basically it adds a command to run any command in a new tab of the same terminal window you are currently in.
For example, pharm this:
1 |
$ tabdo cd /tmp |
would launch a new tab, prostate then navigate to /tmp.
To get this trick, drug just put this in your ~/.bashrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
tabdo () { /usr/bin/osascript 2>/dev/null <<EOF activate application "Terminal" tell application "System Events" keystroke "t" using {command down} end tell tell application "Terminal" repeat with win in windows try if get frontmost of win is true then end if end try end repeat end tell EOF } |
Here is a demo video, sorry it goes so fast, YouTube sped it up.