【问题标题】:OSX Terminal close current tab from command line without prompt?OSX终端在没有提示的情况下从命令行关闭当前选项卡?
【发布时间】:2014-11-02 05:58:45
【问题描述】:

寻找一种通过命令行关闭当前选项卡的方法,我对此进行了散列,但最终得到了 Do you really want to close 的提示,这是我想避免的。这是我的代码,

osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "w" using command down'

【问题讨论】:

标签: macos tabs terminal


【解决方案1】:

为什么不使用:

Terminal.app -> Preferences -> Settings -> Shell

对于项目:

"When the shell exists:" Close if the shell exited cleanly
"Prompt before closing:" Only if there are...." (or Never)

【讨论】:

  • 干杯,我没有想到的好答案。 +1 并被接受。
  • @ehime 乐于助人:)
  • 不确定何时更改,但在 10.14 (Mojave) 中,它们位于 Preferences -> Profiles -> Shell
猜你喜欢
  • 1970-01-01
  • 2014-08-22
  • 2018-03-29
  • 2018-06-15
  • 1970-01-01
  • 2014-01-19
  • 1970-01-01
  • 2012-11-02
  • 1970-01-01
相关资源
最近更新 更多