Open new Terminal Tab from command line (Mac OS X)

前端 未结 13 2322
醉话见心
醉话见心 2020-12-02 04:19

Is it possible to open a new tab in Mac OS X\'s terminal from the command line in a currently opened tab?

I know that the keyboard shortcut to open a new tab in Term

13条回答
  •  孤街浪徒
    2020-12-02 04:42

    The keyboard shortcut cmd-t opens a new tab, so you can pass this keystroke to OSA command as follows:

    osascript -e 'tell application "System Events"' -e 'keystroke "t" using command down' -e 'end tell'

提交回复
热议问题