Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
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

Closed

Description

@matthewmccullough

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?

Activity

  1. kevinsawicki commented on Mar 7, 2014

    @kevinsawicki
    Contributor

    Several halp isssues about this, might be worth revisiting.

  2. thedaniel commented on Mar 17, 2014

    @thedaniel
    Contributor

    i agree this is worth revisiting. so does this person

  3. izuzak commented on Mar 30, 2014

    @izuzak
    Contributor

    More about this:
    support/2ccc32b2b51e11e38d4ef775c416258c
    support/de87d44cbb7311e39a94139b27dcf5b8
    support/c18b1268cb2d11e3804c02fe4adfdaf1

  4. izuzak commented on May 21, 2014

    @izuzak
    Contributor

    Also covers #1433

  5. jingchan commented on May 27, 2014

    @jingchan

    @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.

  6. jingchan commented on May 27, 2014

    @jingchan

    Seems like the close-after-last-tab package 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

  7. izuzak commented on Jun 29, 2014

    @izuzak
    Contributor

    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.

  8. lee-dohm commented on Jun 29, 2014

    @lee-dohm
    Contributor

    @izuzak I just tried the package and it works fine for me in both configurations.

  9. self-assigned this
    on Jul 15, 2014
  10. removed their assignment
    on Jan 21, 2015
  11. fulldecent commented on Feb 19, 2015

    @fulldecent

    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.

  12. ryanseys commented on Mar 11, 2015

    @ryanseys

    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.

  13. mcandre commented on Mar 25, 2015

    @mcandre

    +1

  14. cthielen commented on Mar 30, 2015

    @cthielen

    +1

  15. self-assigned this
    on Jul 6, 2015
  16. 9 remaining items

  17. xianfeng-zhu commented on Oct 13, 2015

    @xianfeng-zhu

    +1

  18. groue commented on Oct 13, 2015

    @groue

    @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.

  19. benogle commented on Oct 13, 2015

    @benogle
    Contributor

    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.

  20. groue commented on Oct 13, 2015

    @groue

    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.

  21. benogle commented on Oct 13, 2015

    @benogle
    Contributor

    For the record, I think this setting should be default to closing the window, but I want to give people an out.

  22. izuzak commented on Nov 23, 2015

    @izuzak
    Contributor

    #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.

    "*":
      core:
        closeEmptyWindows: false
  23. DouweM commented on Nov 23, 2015

    @DouweM
    Contributor

    @izuzak A config option which is also available in the UI: :)

    screenshot

  24. izuzak commented on Nov 23, 2015

    @izuzak
    Contributor

    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 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?

  25. DouweM commented on Nov 23, 2015

    @DouweM
    Contributor

    @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.

  26. izuzak commented on Nov 23, 2015

    @izuzak
    Contributor

    I am not seeing the "Tab: Close Tab" command at all when 0 tabs are open

    I definitely see it:

    screen shot 2015-11-23 at 13 26 45

    Have you made sure that you've focused the pane? (Try clicking on the background tips text after closing the last tab)

  27. DouweM commented on Nov 23, 2015

    @DouweM
    Contributor

    @izuzak Ah, you're right, I see it now. I think we should change the behavior of the tabs:close-tab command do follow the same logic, would you agree?

  28. izuzak commented on Nov 23, 2015

    @izuzak
    Contributor

    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. :bowtie:

    Thanks for investigating this with me! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions