Vscode: Warn before closing the window when closing editor without having editor open

Created on 15 Jul 2016  Â·  10Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 1.3.0
  • OS Version: OS X El Capitan

Steps to Reproduce:

  1. Have a few tabs/editors running in your window
  2. cmd + w to close the current one, until no one is left
  3. Next cmd + w will close the entire editor

Should warn the user that the entire editor will be closed and the choice to cancel.
This is just an idea since it happens all the time for me, though I understand the current implementation as it do exactly what the command says – closes the window.

vscode_closes

*duplicate feature-request

Most helpful comment

@Tyriar kindly shared the following keyboard shortcut via Twitter today when I reached the end of my noose and sent a plea for help to stop VSCode from closing after closing the last editor window:

{ "key": "ctrl+w", "command": "-workbench.action.closeWindow", "when": "!editorIsOpen" }

I owe Daniel a beer as this has been driving me insane for months! See also #1764!

Can't understand why this isn't already the default behavior - can't think of another editor which quits when one CTRL+W's one time too many after last open doc is closed!

All 10 comments

Sorry, I am not getting the problem with closing the last editor? I would understand it if that action has more impact (e.g. close the window), but in this case it does what it does without destroying more UI?

Maybe the issue is with seeing an empty editor space? I find it interesting that Sublime always shows you an empty text buffer if you close the last editor.

@bpasero it is not an error, but an idea to show a modal about the entire editor will close. Not cause it is a behavior which is wrong seen to the command itself but the experience, since you will have to open new window and load recent project to be back in place. I do understand if it won't be considered for implementation, but I like it to be discussed to enhance en experience.

In comparison to for instance a web browser – the browser contains your tabs, the editor contains your tabs but also holds the project which will be closed on window closing.

When you're done with the tabs in your browser, you're done browsing for now.
When you're done with the tabs in your code editor, you might want to do other actions in your still open project.

@slowmove oh now I get it, you are actually closing the entire window with that keybinding. For July we made this configurable via keybindings so you can actually prevent the window from closing. See https://github.com/Microsoft/vscode/issues/1764#issuecomment-230674122

@Tyriar kindly shared the following keyboard shortcut via Twitter today when I reached the end of my noose and sent a plea for help to stop VSCode from closing after closing the last editor window:

{ "key": "ctrl+w", "command": "-workbench.action.closeWindow", "when": "!editorIsOpen" }

I owe Daniel a beer as this has been driving me insane for months! See also #1764!

Can't understand why this isn't already the default behavior - can't think of another editor which quits when one CTRL+W's one time too many after last open doc is closed!

Any other editor with tabs out there for example?

Here are some:

  • Sublime does not close (proposed)
  • Visual Studio does not close (proposed)
  • Atom does close (our current behavior)

I'm for changing it as I kept accidentally closing vscode before we could remove keybindings.

And:

  • Notepad++ doesn't close
  • GVim doesn't close
  • JetBrains' IDE shell doesn't close (e.g. PyCharm)
  • Eclipse doesn't close (as far as I can remember)

Atom/VSCode are the only Editor/IDE's I know of that close if one hits CTRL + [W|F4] one time too many.

This issue has been closed because it is already tracked by another issue. See also our GitHub issues to search for existing issues and our issue reporting guidelines.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

biij5698 picture biij5698  Â·  3Comments

villiv picture villiv  Â·  3Comments

omidgolparvar picture omidgolparvar  Â·  3Comments

curtw picture curtw  Â·  3Comments

sirius1024 picture sirius1024  Â·  3Comments