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

Viewed 621

I'm currently using vs_code on Ubuntu, but I meet the same problem on Mac0S 'multiple desktops'.

WHAT I WANT
Several vs_code windows on different 'ubuntu workspaces', but all on my app folder.

MY WAY OF DOING
I start vs_code from the command line inside my app repo: code .
Then, with Ctrl + Shft + P, I select 'Workspaces: Duplicate Workspace in New Window'.
Next I move the new window to a new ubuntu workspace.

MY PROBLEM
Every time I close a vs_code window created that way, it always prompts me :

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

As you can see, 'Save' button is the default.
It's annoying as I always have to click on 'Don't Save'.

MY NEED

  • a user setting to deactivate the prompt on new workspace exit ?
  • a way around to achieve what I want without a mandatory prompt ?

PS: I know there's a similar Stack Overflow question here, but it's 2 years old now and doesn't have a compelling answer.

1 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, and when no editor window is open, it quits the app.

Related