Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

re-open vscode without last workspace or last files

I wish set VSCode to be launched clean, no last workspace or last files opened.. is this possible?

I use it as unity3d debugger and annoying me all the times that opens a previous workspace (no workspaces saved)

thanks in advance

like image 590
ghiboz Avatar asked Apr 06 '18 12:04

ghiboz


People also ask

How do I reset my Workspace in VS Code?

The easiest way to reset VS Code back to the default settings is to clear your user settings.json file. You can open the settings.json file with the Preferences: Open Settings (JSON) command in the Command Palette (Ctrl+Shift+P).


2 Answers

Besides my comment above, also see open a new window, v1.22 released today if you prefer to open via a command line.

Controls if a new empty window should open when starting a second instance without arguments or if the last running instance should get focus. // - on: open a new empty window // - off: the last active running instance will get focus // Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).

  "window.openWithoutArgumentsInNewWindow": "on"

But the setting

"window.restoreWindows": "none"

should also work for opening in other ways (but seems to require a few restarts - perhaps it has been fixed as of 1.22?).

like image 131
Mark Avatar answered Oct 17 '22 17:10

Mark


None of the other solutions were working for me.

Recently hit this issue where I tried to do a find and replace with 15000 files and vscode crashed while trying to save all those files. I closed the window and re-opened but it kept trying to re-open those 15000 files and would crash again.

I was able to fix this by deleting the corresponding workspace folder (search by folder name) in

/Users/{username}/Library/Application Support/Code/User/workspaceStorage

Then when you reopen that folder nothing is saved or open.

like image 26
tgreen Avatar answered Oct 17 '22 15:10

tgreen