Disable VSCode prompt: “Do you want to save your w

2020-06-14 09:05发布

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?

1条回答
趁早两清
2楼-- · 2020-06-14 09:56

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

查看更多
登录 后发表回答