Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio Mac asks to save file on red "x" out of window #22481

Closed
KyleStay opened this issue Mar 12, 2017 · 3 comments
Closed

Visual Studio Mac asks to save file on red "x" out of window #22481

KyleStay opened this issue Mar 12, 2017 · 3 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code) workbench-hot-exit Preservation of unsaved changes across restarts

Comments

@KyleStay
Copy link

KyleStay commented Mar 12, 2017

  • VSCode Version: 1.10.2 (1.10.2)
  • OS Version: macOS 10.12.3 (16D32)

Steps to Reproduce:

  1. create a new file (no folder open)
  2. enter text in file
  3. click the red "x" in the upper left
  4. VSCode prompts for if user would like to save the file instead of just closing the window even though "hot exit" is on.

Desired functionality:
Window exits without prompting for save and resumes when VSCode is clicked on in dock

@ramya-rao-a ramya-rao-a added the workbench-hot-exit Preservation of unsaved changes across restarts label Mar 12, 2017
@Tyriar
Copy link
Member

Tyriar commented Mar 13, 2017

This is happening because on macOS closing the last window does not close the application. You have two options:

  1. Keep settings as is and prefer cmd+q to kill the application to trigger hot exit
  2. Add "files.hotExit": "onExitAndWindowClose" to your settings which is much less strict about when hot exit is triggered, the only thing to watch out for here is that folder workspaces will not restore when you next launch.

Check the intellisense for the files.hotExit setting in your settings.json for more detail.

@Tyriar Tyriar closed this as completed Mar 13, 2017
@Tyriar Tyriar added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Mar 13, 2017
@KyleStay
Copy link
Author

@Tyriar This does not seem like optimal functionality.

Different functionality could be given to the tab "x" vs. the window "x". Maybe "hot exit" is not what I'm looking for. I "x" out of windows all the time to hide them, many/most macOS applications allow this. VS Code's current implementation prevents me from doing doing this because I will get prompted to save. It would be great if it just closed, and then opened where I left off.

Is there a better place to make a request like this?

@Tyriar
Copy link
Member

Tyriar commented Mar 13, 2017

@KyleStay you're probably after this which is what I use:

{
  // Allow closing any folder window
  "files.hotExit": "onExitAndWindowClose",
  // Restore all windows that were opened after a cmd+q quit
  "window.reopenFolders": "all",
}

The complexity of and things that could go wrong with this feature is much greater than you would probably think. You can check out some of the history on it here #101. Basically we opt for a conservative approach by default where if VS Code is open, all backups are always displayed.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code) workbench-hot-exit Preservation of unsaved changes across restarts
Projects
None yet
Development

No branches or pull requests

3 participants