ehime
ehime

Reputation: 8375

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'

Upvotes: 5

Views: 2595

Answers (1)

clt60
clt60

Reputation: 63902

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)

Upvotes: 6

Related Questions