Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable VSCode prompt: "Do you want to save your workspace configuration"?

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 my needs):

Whenever I attempt to close a window that has files open from multiple, disparate directories, I get the following prompt:

"Do you want to save your workspace configuration as a file?"

A set of buttons is also presented, offering me options.

Screenshot: Screenshot of prompt

This prompt does not come up if I try to close a window with a single file being open, or a single directory.

Here is an example of how to launch VSCode from an OS command prompt, to reproduce this prompt:

code path/to/DirectoryA path/to/DirectoryB

I rarely want, or need, to save a new workspace. I would rather this prompt never appear. I am ok creating workspaces through other means, if and when necessary.

Is there a way to disable this prompt via one or more setting(s) in VSCode?

like image 390
David Ludwig Avatar asked Jan 29 '18 19:01

David Ludwig


People also ask

How do I disable VS Code in Workspace?

If you don't want to permanently remove an extension, you can instead temporarily disable the extension by clicking the gear button at the right of an extension entry. You can disable an extension globally or just for your current Workspace. You will be prompted to reload VS Code after you disable an extension.

How do I stop VS Code pop ups?

Type “editor. hover. enable” into the search field then check/uncheck the checkbox associated with “Controls whether the hover is shown.” to enable/disable the suggestion tooltip on hover.

How do I disable VS Code Workspace trust?

If you don't want VS Code to check for Workspace Trust when opening a new folder or repository, you can set security. workspace. trust. enabled to false.

Where should I save my VS Code Workspace?

Workspace settings will be stored in . vscode/settings. json when you open a folder as workspace.

How do you save code vs configuration?

By default, VS Code requires an explicit action to save your changes to disk, Ctrl+S. However, it's easy to turn on Auto Save , which will save your changes after a configured delay or when focus leaves the editor. With this option turned on, there is no need to explicitly save the file.


2 Answers

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.

like image 166
Pritesh Tupe Avatar answered Sep 18 '22 14:09

Pritesh Tupe


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

like image 30
Sumeet Raina Avatar answered Sep 18 '22 14:09

Sumeet Raina