简体   繁体   中英

OSX Terminal close current tab from command line without prompt?

Looking for a way to close the current tab via the command line, I hashed this out, but end up getting a prompt for Do you really want to close which I would like to avoid. Here's my code,

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

Why didn't use the:

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

and for the items:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM