You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Add option to have cmd-w close the window when there are no editors open #863
When I have multiple buffers open in tabs and a tree view, my past editors (TextMate, Sublime) have conditioned me to expect that a repeated ⌘+w close each buffer's tab, then close the frame and its tree list after the last buffer has been closed. Atom does not behave this way, and I'm curious if this is by design.
It is worth noting that Brackets does also hold the frame open after repeated ⌘+w presses. Is this similarly by design in Atom? Must I switch fingers to ⌘+⇧+w to close the frame?
@thedaniel Thanks for the close-after-last-tab suggestion. I feel at this point it's intuitive tab behavior (among editors and browsers) and should be the default.
As suggested in #2411 (comment), I created a package to cover this functionality. The package can close a window after the last tab is closed or with the last tab (it's configurable).
If someone wants to give it a try -- let me know if you run into any problems. Also, if that package works for everyone, I think we can close this issue.
Seems strange that Cmd+W doesn't close the window on Mac because this is just regular convention across all applications. This felt very much "broken" when I realized I couldn't close the window with Cmd+W.
@benogle, you have changed the title of the issue, by adding "option". I don't know if it's a good idea. On OSX, such behavior has no meaning being an option, since it is a de facto standard.
Yes, an option is important because this behavior has been in since the beginning. There will inevitably be new people who are frustrated by cmd-w closing the window. Whenever we change behavior we see this happen, so we need to minimize frustration.
You know better. Isn't it weird to ship an application which requires a lot of tweaking before if behaves nicely (nice as "just like a regular app")? I've been bitten by those weird default settings already. Now I'm more or less aware that oddities may be fixable by crawling in the (many) options, but it's not quite ideal.
#9607 added support for this (thanks, @DouweM!), so it should reach stable and beta releases in the near future. The feature will be enabled by default, but it's possible to opt-out using a config option.
I was just looking at that and it seems that the description of that config option is a bit misleading. It says "When a window with no tabs or panes is given the 'Close Tab' command, close that window."
However, if I trigger that command (Tabs: Close Tab) through the command palette -- the windows is not closed. It's closed only when I hit cmd-w or trigger the Core: Close command through the command palette. Do you see the same behavior? If so, do you think we should clarify that or make some changes?
@izuzak Hmm. The "Close Tab" I'm referring to is the "Close Tab" in the File menu, which is mapped to Cmd-W and fires the core:close command. It is defined by Atom itself and does indeed also appear as "Core: Close" in the command palette.
"Tabs: Close Tab", on the other hand, is the tabs:close-tab command defined by the tabs package, and is not affected. We could patch tabs to show the same behavior, but I am not seeing the "Tab: Close Tab" command at all when 0 tabs are open, so I think we don't need to change anything.
I think we should change the behavior of the tabs:close-tab command do follow the same logic, would you agree?
I'm not sure, to be honest. How do you feel about creating a new issue for this, mentioning some of the possibilities (changing the description, updating tabs:close, ...) and pinging the folks that were involved in your PR? I think that's the best way to discuss this and also reduce the noise on this issue, which I'm pretty sure is followed by lots of folks.
Activity
kevinsawicki commentedon Mar 7, 2014
Several halp isssues about this, might be worth revisiting.
thedaniel commentedon Mar 17, 2014
i agree this is worth revisiting. so does this person
izuzak commentedon Mar 30, 2014
More about this:
support/2ccc32b2b51e11e38d4ef775c416258c
support/de87d44cbb7311e39a94139b27dcf5b8
support/c18b1268cb2d11e3804c02fe4adfdaf1
izuzak commentedon May 21, 2014
Also covers #1433
jingchan commentedon May 27, 2014
@thedaniel Thanks for the close-after-last-tab suggestion. I feel at this point it's intuitive tab behavior (among editors and browsers) and should be the default.
jingchan commentedon May 27, 2014
Seems like the
close-after-last-tabpackage closes the editor window along with the last tab, rather than from a key press afterwards.This patch implements the correct behavior, but I'm not sure if it is written in the right location:
https://github.com/jingchan/atom/commit/e40aed08c92790772e3dbbcf79814bcc19d79d1a
izuzak commentedon Jun 29, 2014
As suggested in #2411 (comment), I created a package to cover this functionality. The package can close a window after the last tab is closed or with the last tab (it's configurable).
If someone wants to give it a try -- let me know if you run into any problems. Also, if that package works for everyone, I think we can close this issue.
lee-dohm commentedon Jun 29, 2014
@izuzak I just tried the package and it works fine for me in both configurations.
fulldecent commentedon Feb 19, 2015
For me, this is intuitive:
A file is open and you press Cmd-W: This closes the last file, and focus returns to the file tree so you can up/down/enter to open another file.
No file is open and you press Cmd-W: The full MDI window closes.
ryanseys commentedon Mar 11, 2015
Seems strange that Cmd+W doesn't close the window on Mac because this is just regular convention across all applications. This felt very much "broken" when I realized I couldn't close the window with Cmd+W.
mcandre commentedon Mar 25, 2015
+1
cthielen commentedon Mar 30, 2015
+1
9 remaining items
xianfeng-zhu commentedon Oct 13, 2015
+1
groue commentedon Oct 13, 2015
@benogle, you have changed the title of the issue, by adding "option". I don't know if it's a good idea. On OSX, such behavior has no meaning being an option, since it is a de facto standard.
benogle commentedon Oct 13, 2015
Yes, an option is important because this behavior has been in since the beginning. There will inevitably be new people who are frustrated by
cmd-wclosing the window. Whenever we change behavior we see this happen, so we need to minimize frustration.groue commentedon Oct 13, 2015
You know better. Isn't it weird to ship an application which requires a lot of tweaking before if behaves nicely (nice as "just like a regular app")? I've been bitten by those weird default settings already. Now I'm more or less aware that oddities may be fixable by crawling in the (many) options, but it's not quite ideal.
benogle commentedon Oct 13, 2015
For the record, I think this setting should be default to closing the window, but I want to give people an out.
izuzak commentedon Nov 23, 2015
#9607 added support for this (thanks, @DouweM!), so it should reach stable and beta releases in the near future. The feature will be enabled by default, but it's possible to opt-out using a config option.
DouweM commentedon Nov 23, 2015
@izuzak A config option which is also available in the UI: :)
izuzak commentedon Nov 23, 2015
Thanks, @DouweM. :)
I was just looking at that and it seems that the description of that config option is a bit misleading. It says "When a window with no tabs or panes is given the 'Close Tab' command, close that window."
However, if I trigger that command (
Tabs: Close Tab) through the command palette -- the windows is not closed. It's closed only when I hitcmd-wor trigger theCore: Closecommand through the command palette. Do you see the same behavior? If so, do you think we should clarify that or make some changes?DouweM commentedon Nov 23, 2015
@izuzak Hmm. The "Close Tab" I'm referring to is the "Close Tab" in the File menu, which is mapped to
Cmd-Wand fires thecore:closecommand. It is defined by Atom itself and does indeed also appear as "Core: Close" in the command palette."Tabs: Close Tab", on the other hand, is the
tabs:close-tabcommand defined by thetabspackage, and is not affected. We could patchtabsto show the same behavior, but I am not seeing the "Tab: Close Tab" command at all when 0 tabs are open, so I think we don't need to change anything.izuzak commentedon Nov 23, 2015
I definitely see it:
Have you made sure that you've focused the pane? (Try clicking on the background tips text after closing the last tab)
DouweM commentedon Nov 23, 2015
@izuzak Ah, you're right, I see it now. I think we should change the behavior of the
tabs:close-tabcommand do follow the same logic, would you agree?izuzak commentedon Nov 23, 2015
I'm not sure, to be honest. How do you feel about creating a new issue for this, mentioning some of the possibilities (changing the description, updating tabs:close, ...) and pinging the folks that were involved in your PR? I think that's the best way to discuss this and also reduce the noise on this issue, which I'm pretty sure is followed by lots of folks.
Thanks for investigating this with me! 🙇