Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code never reopens previous file or folder

I have the exact opposite Problem of this question: Visual Studio Code always reopens previous file or folder

VSCode never seems to remembery my previously opened files and does always start with an empty window. I checked, if my Shortcut has the Parameter "-n" by accident (which would force this behaviour), but it's not there.

Is there a way to force VSCode to remember opened files and folders?

like image 712
phifi Avatar asked Mar 31 '16 08:03

phifi


People also ask

How do I turn off autoSave in VS Code?

For more control over Auto Save , open User or Workspace settings and find the associated settings: files. autoSave : Can have the values: off - to disable auto save.

How do I open recently closed tabs in VS Code?

In Visual Studio 2020 you can use Shift + Ctrl + T , which is associated with Reopen Closed Editor. This should do what you're expecting. You are speaking of VS Code. In VS Code the default is: { "key": "ctrl+shift+t", "command": "workbench.


1 Answers

It seems, VsCode only remembers opened files, if you also have a folder opened. It doesn't matter, if this is just a Dummy Folder somewhere on your drive - if you open files outside of this folder, they will be remembered aswell.

I'm not sure if this is as designed, or a bug.

Edit: This is a bug and tracked here

Edit 2: To sum up the answers from below there are now two settings concerning this issue:

Hot exit has been implemented, which restores files which weren't saved before VS Code is closed. To change this, use this setting:

files.hotExit: "onExit" 

To reopen all files, use this setting:

window.restoreWindows: "all" 

But there is still on open issue with this found here.

...

like image 167
phifi Avatar answered Sep 28 '22 17:09

phifi