Ctrl W not close app
Discuss: Ctrl-W on last tab should not close the window. Ref: bug in bugzilla.
Proposed change
Ctrl+w should behave as the tab bar's close button already does, and as Ctrl+F4 already does, and as right click on tab -> "Close tab" already does. Ctrl+W and File->Close Tab should be consistent with every other tab-closing method, and close the tab, but not the window.
In detail:
- Ctrl+W will close the selected tab, as per currently, until only one tab is left.
- When that tab is left, Ctrl+W will blank the tab and clear session history (basically a quicker way of closing the tab and creating a new one).
- If Ctrl+W is pressed again, treat as above - i.e. you still have the window open, with one blank tab, with no session history.
Arguments in favour and against
Pro
- Inconsistency: Close tab button and Ctrl-W are currently inconsistent ("close tab button" keeps app open, ctrl-W closes the (possibly last) window). Also in the same way, currently inconsistent with right click on tab -> "Close tab" (which cannot close the app). Also in the same way, currently inconsistent with middle button click on tab (closes tab, but not the window, even if only tab left).
- There's already a keyboard shortcut for closing the window (SHIFT+CTRL+W).
- Surprise: The current behaviour is often surprising - "Whoa! Where did my browser window just go?". New behaviour will not be surprising to the new user in this way.
- Precedent in other multi-tabbed browsers: This is how tab closing via Ctrl-W works in IE7, NetCaptor, and Opera, among others.
- Clarity: Closing the tab and closing the window are two very different things - one means "I'm done with the current block of information, but this app is still useful to me", and the other means "this entire app is no longer of any use to me" - they are conceptually different things. At the moment this is being muddied by having the meaning of Ctrl-W change between these two things, depending on context.
- Easier to close all tabs without closing the browser (by holding Ctrl+W).
- Firefox supports multiwindow tabless browsing; ctrl-w closing the document but not the window is consistent with applications such as MS Office 2000 and GEdit (GNOME text editor; it will actually close a window with ctrl-W, but not the last window).
- Currently, when I'm done with a tab, I cannot always safely press Ctrl+W, and assume that the right thing will happen (the tab will close, but the window will stay open). As I have to press a different shortcut to close a tab when it is the only one left, I sometimes accidentally press the Ctrl-W shortcut without realizing that it will close the window.
- Blanking a tab is a useful action if you browse in single-window-mode (as the window is long-lived, whereas the tab is disposable - so we want the window to stick around, but need a way of clearing the content from the last tab when we are done with it, without closing the window)
- For people who usually use tabs rather than windows, it's nice to have an easy-to-press shortcut (Ctrl+W) to close only the tab.
Con
- It's a change in the User Interface from how it was in Firefox 1.0 and 1.5.
- Closing a tab that creates a new blank tab is arguably not closing a tab.
- Users on UNIX systems wanting mouse keyboard bindings may want a key binding that uses two keys rather than 3 to close the window (although Alt-F4 may do this?).
- There's already a keyboard shortcut for closing the tab, if not the last one (ctrl-F4).
- Firefox supports multiwindow tabless browsing; ctrl-w not closing the window along with its directly contained document is inconsistent with IE6 and other tabless applications.
- The current document-centric ctrl-w behavior discards a window, as it does a tab, when the window no longer contains a document. The proposal makes the window widget "heavier" favoring it over the document concept; instead of the application getting out of the way when the user is done with the document, it demands that the user deal specifically with the window to close it with e.g. a different keybinding.
- Currently, when I'm done with a document, I can safely press Ctrl+W, and the right thing will happen (the tab will close, or the window will close). If I had to press a different shortcut to close a window, I'd sometimes accidentally press the shortcut to close a window without realizing that I had other tabs open.
- Blanking a tab isn't an especially useful action.
- For people who usually use windows rather than tabs, it's nice to have an easy-to-press shortcut (Ctrl+W) to close the window.
Should this be a preference?
If finding a single behaviour that works for everyone is intractable, then perhaps it should be a boolean preference between the current behaviour and the behaviour described above in the use-case?
Pro having a pref
- It would allow the user to select the best trade-off of the pros and cons above, at their discretion.
- There may be an element of the religious emacs-vs-vi / pro-life-versus-pro-choice debate to this: People who care tend to have a strong preference one way or the other, depending on their personal browsing style and which UI they think works best, and it may be that no amount of discussion will change that viewpoint. In particular, do you mostly browse with tabless single windows, or mostly with a multi-tabbed single window? Perhaps whichever mode you are closest to will drive your assumptions the most about expected behaviour.
Con having a pref
- It would introduce yet another preference, when the overall direction seems to be towards reducing the number of preferences.
Alternative suggestions
Behavior dependent on tab bar visibility
Instead of creating yet-another-pref, why not have this behavior dependent on tab bar visibility: if you choose to not hide the tab bar with only one tab left, you stay in tabbed browsing mode and Ctrl+W blanks the tab - mimicking an MDI application; otherwise you leave tabbed browsing mode and Ctrl+W closes the window as other SDI applications are closed (e.g. MSIE and Windows Explorer). --zeniko 14:59, 14 Mar 2006 (PST)
Pro
- You have the choice, but no new preference is needed
- The behavior is logically tied to either pseudo-MDI- or pseudo-SDI-mode (since Firefox is a hybrid, you can choose what side it should tend to)
- You see what the current behavior is (visible or hidden tab bar)
- The current default behavior remains unchanged
Con
- The difference between pseudo-MDI- and pseudo-SDI-mode isn't always obvious
- You'll need an extension if you want to break this logical tie
Question
- If the use-case was changed so that:
- Ctrl+W will close the selected tab, as per currently, until only one tab is left in the current window.
- If the number of open windows was >= 2, then pressing Ctrl-W would close the current window.
- Otherwise, when only one tab in one window is left, Ctrl+W will blank the tab and clear session history (basically a quicker way of closing the tab and creating a new one).
- ... would this be a suitable compromise? That would allow the tabless users to close windows (apart from the very last one), and it would allow the single-window-mode users to not have their one window closed.
- This is what gedit 2.10.5 does (except for blank document creation). The visible results of Ctrl-W being dependent in this way on whether there happen to be other gedit windows open somewhere is weird, imo. --Tuukka 16:58, 24 Jan 2006 (PST)