Warn or disable command + W

4,483 views
Skip to first unread message

Anton Daneyko

unread,
Jan 17, 2013, 7:56:45 PM1/17/13
to iterm2-...@googlegroups.com
Dear All,
Is there a way to disable the closing of the tab on command+W? If not disable, then ask for a confirmation? 
It's not the first time this happens to me: I accidentally hit command+W instead of command+2.

Xian Xu

unread,
Jan 17, 2013, 8:05:11 PM1/17/13
to iterm2-...@googlegroups.com
there already is option for warning i think, in the general settings.

Tom Feist

unread,
Jan 17, 2013, 8:35:38 PM1/17/13
to iterm2-...@googlegroups.com
I think iTerm only supports internally the confirmation for Cmd-Q, and 'close multiple sessions', neither of
which would trigger for a single tab Cmd-W.

I'm using Butler (http://manytricks.com/butler/) which can support global hotkeys to trap Cmd-W (active only when
iTerm is frontmost app), and ignore it. You could probably do the same, or use the OSX System Preferences keyboard
shortcuts config to rebind it to something less easy to fatfinger.

System Prefs -> Keyboard -> Keyboard Shortcuts -> select 'Application Shortcuts' -> '+', select iTerm from list,
set command to be 'Close', and set a shortcut of something unlikely like Cmd-Ctrl-Shift-W or so.

HTH. Cheers,

Tom

TJ Luoma

unread,
Jan 17, 2013, 8:58:38 PM1/17/13
to iterm2-...@googlegroups.com

Dave Albert

unread,
Sep 9, 2014, 2:53:33 AM9/9/14
to iterm2-...@googlegroups.com
You can set an iTerm2 shortcut key to "ignore". Then is you want a short cut to close a tab/window you could add another shortcut <alt><cmd>w to close.


Samuel Gómez

unread,
Sep 29, 2014, 3:49:17 AM9/29/14
to iterm2-...@googlegroups.com

Upvote

王然

unread,
Aug 14, 2018, 10:27:41 PM8/14/18
to iterm2-discuss
Great! Thank you!

在 2014年9月9日星期二 UTC+8下午2:53:33,Dave Albert写道:
Reply all
Reply to author
Forward
0 new messages