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

前端 未结 4 679
野性不改
野性不改 2021-02-07 23:42

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

相关标签:
4条回答
  • 2021-02-08 00:05

    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

    0 讨论(0)
  • 2021-02-08 00:08

    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.

    0 讨论(0)
  • 2021-02-08 00:10

    @HaiFengKao's comment mentions workbench.action.quit that quits vscode without any prompts.

    Shortcut for it is Ctrl + Q but it quits all windows :(

    0 讨论(0)
  • 2021-02-08 00:15

    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

    0 讨论(0)
提交回复
热议问题