Close window when closing the only remaining tab #2795
Conversation
|
There has been some discussion as to the appropriate behaviour for a file manager when closing the last tab with different solutions proposed. See #327 and #1474. I do not personally see the utility of closing an app by closing a tab even though browsers and Terminal do. I understand the possible need for a way of closing just the current window with the keyboard but that is a different issue. @danirabbit Would you like to see consistency between Files, Terminal, Code (and Browser)? If so what should be the common behaviour? Or is the correct behaviour dependent on the app? |
|
Ah, I did not know that this was intended behavior, my bad. I see that some excellent points were made in #327, so I can only add my intent here: My intent is: I'm done with these tabs, I don't want them restored at any point in the future, and I want them all to go away because I'm done with my file operation for now. Files is not really an application that I'm "doing work in", so to speak, so more often than not, if I close all my tabs, I don't want to "continue using Files". I press I think this is also what used to happen on Mac OS (it's been quite a few years since I've last used it), and I think it's also what happens in browsers on Windows. The current re-opening-a-new-tab behavior has a bug by the way: pressing (Ironically, that was the exact scenario that danirabbit described here, except right now Files actually crashes when you mash If we don't want to change the behavior in Files, I can make a fix to this crashing bug. I'll follow the discussion here and see where we land. Thanks for taking the time anyway! |
|
Although elementaryos tries to avoid unnecessary settings, if there are really two equally valid behaviours then adding another switch to the app menu is a possibility. Thanks for pointing out that crash - it certainly needs fixing. |
|
My personal opinion is that I don't usually love when one button does two different things, especially if one of those things is destructive. We do however run into an issue where we don't have full control over the behavior of the web browser, so if our top priority is consistent behavior we might just have to follow that unless we can get upstream to carry a special behavior for us. It sounds like what we might be hearing from folks though is that they're using the keyboard shortcut here and not the tab close button. So perhaps we should consider that the keyboard shortcut would close the window if there's only one tab but keep the current behavior for clicking the tab close button? Would that solve this issue for you @stan-janssen? |
|
I agree that having two actions from the same button feels wrong, but the button itself always closes the tab - what happens afterwards may vary. At the moment there are three different behaviours across (at least) four system apps - Files, Terminal, Code, Browser. I notice that Gnome Text Editor has yet another behaviour - that is to hide the tabbar when there is only one tab essentially preventing closing the last tab with the mouse (although the shortcut still works). If the tab is closed with the shortcut then it is replaced by a landing page, not a new document - mirroring Code. The same happens with Gnome File Manager (nautilus) except the window closes if the tab is closed with the shortcut - as is proposed here. On reflection, I could live with closing the Files window on closing the last tab as, like Terminal, there is no sensible "landing page" for this type of app that I can think of. Then 3 out of 4 of the system apps with a tabbed view would behave the same way. Code can be regarded as different as an editor. Of course, the "no tabs" state cannot be restored - you will still end up with a home directory tab on restarting Files if it is the primary window that closes. The home directory would still be only one click (bookmark) or shortcut (Alt+Home) away so nothing is really lost and we gain a shortcut for closing just the current window (indirectly) |
|
Will need to consider the text for the "Close Tab" option in the tab context menu (which is linked to the |
This closes the Files window when the only tab in that window is closed:
files-tab-closing.mp4
This makes the behavior consistent with other default apps like Terminal and Web, which also close their window when the last tab closes.
This also makes it possible to close a Files window using just the keyboard. Previously, one could only close tabs using
ctrl + W, or close all windows usingctrl + Q, but not close just one window.