Using the latest, released version of VSCode, at the time of this writing (2018-Jan-29; version 1.19.3), I see the following behavior (which is unnecessarily time-consuming, for
I have updated my extension to quit vscode when all editors are closed
https://marketplace.visualstudio.com/items?itemName=Hai.AlwaysOpenWorkspace
The trick is to call vscode.commands.executeCommand('workbench.action.quit');
when all editors are closed.
workbench.action.quit
will quit vscode without any prompts
I solved this issue by adding following in keybindings.json -
{
"key": "cmd+w",
"when": "!editorIsOpen && !multipleEditorGroups",
"command": "workbench.action.quit"
}
Normally, cmd+w will close the editor window (with checks for unsaved as well), and when no editor window is open, it quits the app.
@HaiFengKao's comment mentions workbench.action.quit
that quits vscode without any prompts.
Shortcut for it is Ctrl + Q
but it quits all windows :(
I was having similar issue Untitled.code-workspace file being created as I just close my laptop and never properly close Vs code. I would delete them manually but somehow Git was still tracking these files whenever I push my code to the branch.
In any case we want to stop these files from being generated for that purpose follow the steps below:
Go to code -> preferences -> settings -> under commonly used -> Files:Exclude -> Add Pattern -> **/.code-workspace
that would disable the prompt and no such files would be created again.
#disable-vscode-prompt #untitled.code-workspace #disable #autosave #vscode-workspace-disable #workspace #vscode-workspace