Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Opens a new Terminal Tab and executes command
function execInNewTerminalTab {
osascript -e 'tell application "Terminal"
activate
tell application "System Events" to keystroke "t" using command down
do script "'"$1"'" in window 1
end tell'
}
@HaNdTriX

This comment has been minimized.

Copy link
Owner Author

@HaNdTriX HaNdTriX commented Jun 18, 2015

Usage

execInNewTab "echo Hello World"
execInNewTab "echo Hello World"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.