Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

close window on last pane - #2986

Closed
thedaniel wants to merge 3 commits into
masterfrom
dh-close-window-on-last-pane
Closed

thedaniel wants to merge 3 commits into
masterfrom
dh-close-window-on-last-pane

Conversation

@thedaniel

Copy link
Copy Markdown
Contributor

fixes #863

Sets this behavior as the default.

@lee-dohm

Copy link
Copy Markdown
Contributor

@izuzak actually created a package, the-closer, that covers this functionality and is configurable between the two requested versions of this functionality:

  1. Close window when Cmd+W is pressed on the last item, i.e. the last tab in a single pane
  2. Close window when Cmd+W is pressed after the last item has been closed, i.e. close the last tab in a single pane ... then press Cmd+W one more time to close the window

Personally, I prefer the current way ... which is that the window doesn't close unless I explicitly request it by pressing Shift+Cmd+W. If Atom Core is going to take on this functionality, I feel it should cover all three scenarios.

@thedaniel

Copy link
Copy Markdown
Contributor Author

It's hard to say without dredging up a bunch of usage data where to draw the line between core behavior and things that belong in packages. If this PR or something like it lands, the behavior can be disabled and @izuzak's package will still add additional options.

I'm not necessarily wedded to the behavior in this PR but I think it's worth being cautious about how many settings we put in core (2 vs 3 in this case) before settings-view seriously levels up, to avoid having a sea of checkboxes.

Does anyone have a good feeling from the forums or from other sources of feedback of how often the various kinds of close behavior are requested?

@philipgiuliani

Copy link
Copy Markdown
Contributor

I would set the default setting to false, becausw im always closing all tabs, but i want to keep my project open and im sure thats the behaviour that an ide should have.

@lee-dohm

Copy link
Copy Markdown
Contributor

The major topic on the board about this is here: http://discuss.atom.io/t/closing-whole-editor-instance-on-cmd-w/2272

It appears to me that the majority favors the close after last tab behavior, but this kind of guessing of user preferences is sketchy sometimes.

We also don't necessarily have to have settings for everything, perhaps just provide multiple commands: core:close, core:close-after-last-tab, core:close-with-last-tab and let people control it via their keymap.cson. I think for "advanced user" features this is a solid compromise between offering the functionality and keeping the settings view clean.

@batjko

batjko commented Jul 20, 2014

Copy link
Copy Markdown
Contributor

Agreed. Unless there is a very clear majority on one specific behavior, in which case putting it into core would be warranted, it should be realized as a number of options available for people to customize via their own keymaps or packages.

It seems here there isn't that majority, so... I'm with @lee-dohm on this one.

@firedev

firedev commented Jul 29, 2014

Copy link
Copy Markdown

So what about close:all-tabs is there a command for that?

@lee-dohm

Copy link
Copy Markdown
Contributor

@firedev No, there currently is no command for that. You might want to implement such a thing as a pull request for Atom Core or perhaps @izuzak's the-closer package.

@izuzak

izuzak commented Jul 29, 2014

Copy link
Copy Markdown
Contributor

@firedev No, there currently is no command for that.

Interestingly, there is such a command, but it's scoped to the tab bar view:

https://github.com/atom/tabs/blob/master/lib/tab-bar-view.coffee#L18

There's an issue atom/tabs#61 to make these commands available, so that might be a good approach? Maybe? 😄

@lee-dohm

Copy link
Copy Markdown
Contributor

Oh interesting. I searched using the Command Palette and didn't find anything. I guess the Command Palette only finds commands on the WorkspaceView and those are only on the TabBarView.

Thanks for correcting me @izuzak!

@izuzak

izuzak commented Mar 3, 2015

Copy link
Copy Markdown
Contributor

Here's some more information to help us reach a decision here:

  1. SublimeText has an option called close_windows_when_empty, which has this description

    Set to true to close windows as soon as the last file is closed, unless there's a folder open within the window. This is always enabled on OS X, changing it here won't modify the behavior.

  2. I've received some feedback about my the-closer package (via email), and I've been asking which option is more useful to users. Here's a typical response:

    I use cmd-w to slide the last document, and then cmd-w again to close the project. It's pretty common that I want to close all docs, but leave the project open.

  3. The feedback on the forum and the original issue seems to be in favor of the "close window when no tabs empty but not together with the last tab" behavior.

I agree with @thedaniel that we shouldn't be adding checkboxes for every option. 👍 However, we now also have the option of making this a dropdown choice, so we could have a single setting with the options "nope", "close after last tab is closed", "close together with the last tab". :lightbulb:

I also wouldn't mind picking the more popular option (close after last tab is closed, not with it), and asking users to install a package if they want more options.

Any other thoughts, everyone? Also, @thedaniel -- are you still interested in working on this? I noticed that this PR no longer merges cleanly, so it probably needs some cleanup or someone could open a new one if you have a full plate.

@lee-dohm

lee-dohm commented Mar 3, 2015

Copy link
Copy Markdown
Contributor

I'm ok with this being a dropdown setting now that it's an option.

@thedaniel

Copy link
Copy Markdown
Contributor Author

@izuzak Happy to work on it, I just didn't push this because it seemed most of the work was in debating the various kinds of behavior, not the code :)

@kevinsawicki

Copy link
Copy Markdown
Contributor

Closing this out since it pretty outdated now and no longer merges cleanly, feel free to reopen when updated.

@kevinsawicki
kevinsawicki deleted the dh-close-window-on-last-pane branch July 28, 2015 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to have cmd-w close the window when there are no editors open

7 participants