Skip to content

Instantly share code, notes, and snippets.

@HaNdTriX
Created June 18, 2015 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HaNdTriX/8cebc0be06f41077cd7a to your computer and use it in GitHub Desktop.
Save HaNdTriX/8cebc0be06f41077cd7a to your computer and use it in GitHub Desktop.
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
Copy link
Author

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