【问题标题】:Multiple tabs in os X terminal using CLI使用 CLI 的 os X 终端中的多个选项卡
【发布时间】:2017-06-12 03:28:22
【问题描述】:

我需要打开多个选项卡并调用一些服务,然后将它们作为关机的一部分关闭。

目前我所尝试的只是

osascript -e '告诉应用程序“终端”激活' -e 'tell 应用程序“系统事件”告诉进程“终端”击键 "t" 使用命令向下'

It opens a tab; but how can I 
a) Give the tab a name
b) Invoke a process

我也试过了

osascript -e '告诉应用程序“终端”激活' -e 'tell 应用程序“系统事件”告诉进程“终端”击键 "t" 使用命令 down' -e '告诉应用程序 "Terminal" 执行脚本 在前窗口的选定选项卡中“回显你好”

在我调用脚本的主窗口中打印 hello。

任何建议都会有所帮助。

【问题讨论】:

    标签: macos terminal


    【解决方案1】:

    我以前见过这样的东西,有人发过这个。

    https://www.npmjs.com/package/ttab 要安装,您需要 Node.js,但它非常简单,只需运行即可。

    npm install -g ttab

    还有这个 bash 脚本可以安装它。 https://raw.githubusercontent.com/mklement0/ttab/stable/bin/ttab

    【讨论】:

      猜你喜欢
      • 2015-02-11
      • 2011-11-02
      • 1970-01-01
      • 2022-10-15
      • 2015-04-07
      • 1970-01-01
      • 1970-01-01
      • 2012-05-26
      • 2011-10-07
      相关资源
      最近更新 更多