You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remember all UI state even when reopening window without workspace #207
Currently, reopen files behaviour is slightly weird. If no folders are open, no files are reopened upon restart of VSC. If a folder is open, any files that are opened, inside the opened folder or not, are reopened upon restart of VSC.
I would like to see VSC reopen files, regardless the opened folder count. Should probably be settable in the preferences, I can imagine not everyone is interested in this behaviour.
Reacted by benamada, Omid Saadat, Joshua Sleeper, Mihai Vilcu, Jonathan, SeanWcom, Ivan171, Rasmus Sigsgaard, MarPan, NitroG42 and 56 more
Reacted by Jonathan, Barnaby Claydon, dmytro-y-dev and edubsi
Reacted by Jonathan, Barnaby Claydon, g-kozulis, dmytro-y-dev and edubsi
Not sure about the scope of this issue, but I have a related problem. Let me know if I should report it in a separate issue.
If I have multiple projects open in VS Code (e.g. 2 separate windows, each with a folder loaded) and I restart VS Code (e.g. due to an update), only the last project that was opened gets automatically reloaded.
I think it should be on VS Code to completely restore the UI state after a restart. Chrome, for example, does this--it reloads both the correct number of windows, as well as the correct tabs within each window.
I understand from the discussion in #264 that there is some issue with restoring state for standalone files that are opened (as opposed folders), but in my case it was 2 folders that were open.
Nicholas Chammas (@nchammas) you can enable restoring of all windows through the window.reopenFolders setting. Set it to all and you should be all set.
Hi Benjamin Pasero (@bpasero). Just double checking, in the insiders preview looks like the new option is window.restoreWindows right? As I understand it, the value mentioned by BobbyBabes (last) is probably the new default (now called one) right?
Looks like it is working fine. My only problem with the current version - and I'm not sure if it this is directly related - is that VS Code behavior feels odd when I have unsaved files and open a new folder.
Currently VS Code displays a prompt asking if I want to save new files. If I don't do it the files are gone forever. This happens even with "files.hotExit": "onExitAndWindowClose".
I would expect unsaved files to be "carried forward" and simply be there after I open a new folder.
If I switch between two folders or if I close a folder and open it again everything works as expected (i.e., previous unsaved files are kept - unsaved files are "bound" to the current folder). The problem only manifests itself when no folder is currently open in the editor.
Assume that I have two windows open, each pointing to a different folder. If I right click Visual Studio Code Icon and select "Close all windows".
I would expect both windows to be restored the next time I launch vscode, instead I'm getting either an empty window or only one of the two previously open windows.
I would argue that "Close All Windows" should not restore the windows because you are actually closing all of them. In the same way if you close a single window we would never restore it.
If you use File > Exit the windows will restore properly and that is the intent of the window.reopenWindows setting.
Benjamin Pasero (@bpasero) Just wanted to thank you for adding this feature, it was one of my biggest gripes with VS Code before since I work with multiple windows some of which has files from different locations. Hunting them down and re-opening them every time VS Code restarts was a pain!
Version 1.14.2
Commit cb82febafda0c8c199b9201ad274e25d9a76874e
Date 2017-07-19T23:26:08.116Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
"uname --all" output:
Linux designbox 4.11.9-1-ARCH #1 SMP PREEMPT Wed Jul 5 18:23:08 CEST 2017 x86_64 GNU/Linux`
Preferences: `"window.restoreWindows": "all"`
One VSC window with a project folder opened. All files saved.
One VSC window with just a bunch of files opened. Some with unsaved changes.
Ctrl+Q to close all VSC windows and quit VSC.
Reopening VSC (as per the title of this issue) works as expected. Both windows are restored with all files.
Ctrl+Q again.
Then double-clicking a source file in the file manager, opens one VSC window with just the double-clicked file.
Ctrl+Q again.
Start VSC from its icon, and one window opened with just the one file (that was double-clicked from the file manager).
I restored the initial 2 windows with Ctrl+N, followed by Open recent.
I had expected that starting VSC from its icon, would first open the 2 VSC windows. And that the source file (double clicked from the file manager) would be added to one of the 2 VSC windows. And that that window would be pushed to the foreground.
Similar to what happens when there are already VSC windows opened, and you then double-click a source file from the file manager.
So my question is : is this intentional, and should I therefore open a request for this behaviour to be added ?
Hi everyone, I'm trying to change from Sublime to VS Code so keep the old files is important for me , but I just install the version: 1.15.0-insider, and I'm not able to find the property "window.reopenWindows".
I do have "window.restoreWindows": "all". And of course, is not restoring all the files previously opened.
BobbyBabes yeah that seems like a separate issue to me, you seem to want to restore your context if you start Code via the icon and ignore sessions where you opened code with a specific file. I think it should be reported as such.
Today we simply restore your last session, no matter how you got there (e.g. by clicking the icon or opening a file).
Angel Curros (@Curros) the setting is now called "window.restoreWindows": "all". If it does not work please report a new issue with steps how to reproduce.
Today we simply restore your last session, no matter how you got there (e.g. by clicking the icon or opening a file).
Are you saying the current intended behavior is to restore all open editors, both clean and dirty, regardless of whether VS Code is launched by the icon or launched by opening a file? Because it seems to me that the "window.restoreWindows": "all" setting is only applying to the former.
Activity
bpasero commentedon Nov 19, 2015
Fair request.
PooLP commentedon Nov 19, 2015
+1
nchammas commentedon Dec 2, 2015
Not sure about the scope of this issue, but I have a related problem. Let me know if I should report it in a separate issue.
If I have multiple projects open in VS Code (e.g. 2 separate windows, each with a folder loaded) and I restart VS Code (e.g. due to an update), only the last project that was opened gets automatically reloaded.
I think it should be on VS Code to completely restore the UI state after a restart. Chrome, for example, does this--it reloads both the correct number of windows, as well as the correct tabs within each window.
I understand from the discussion in #264 that there is some issue with restoring state for standalone files that are opened (as opposed folders), but in my case it was 2 folders that were open.
I'm running Code 0.10.3 on OS X.
bpasero commentedon Dec 2, 2015
Nicholas Chammas (@nchammas) you can enable restoring of all windows through the
window.reopenFolderssetting. Set it toalland you should be all set.nchammas commentedon Dec 2, 2015
Oh snap. Good call--that did the job. 👍
nautilusbits commentedon Apr 21, 2016
So if no folders are open, opened files are not reopened after restart VSC? A bit dumb.
bpasero commentedon Apr 21, 2016
Yes, only if you open a folder we remember all UI state.
[-]Reopen files[/-][+]Remember all UI state even when reopening window without workspace[/+]59 remaining items
aaccioly commentedon Jul 10, 2017
Hi Benjamin Pasero (@bpasero). Just double checking, in the insiders preview looks like the new option is
window.restoreWindowsright? As I understand it, the value mentioned by BobbyBabes (last) is probably the new default (now calledone) right?Looks like it is working fine. My only problem with the current version - and I'm not sure if it this is directly related - is that VS Code behavior feels odd when I have unsaved files and open a new folder.
Currently VS Code displays a prompt asking if I want to save new files. If I don't do it the files are gone forever. This happens even with
"files.hotExit": "onExitAndWindowClose".I would expect unsaved files to be "carried forward" and simply be there after I open a new folder.
If I switch between two folders or if I close a folder and open it again everything works as expected (i.e., previous unsaved files are kept - unsaved files are "bound" to the current folder). The problem only manifests itself when no folder is currently open in the editor.
aaccioly commentedon Jul 10, 2017
Another problem is that I'm not getting the expected behavior with:
Assume that I have two windows open, each pointing to a different folder. If I right click Visual Studio Code Icon and select "Close all windows".
I would expect both windows to be restored the next time I launch vscode, instead I'm getting either an empty window or only one of the two previously open windows.
bpasero commentedon Jul 10, 2017
Anthony Accioly (@aaccioly) can you file this as separate issue, it seems unrelated.
aaccioly commentedon Jul 11, 2017
Hi Benjamin Pasero (@bpasero), ok, will do.
bpasero commentedon Jul 11, 2017
I would argue that "Close All Windows" should not restore the windows because you are actually closing all of them. In the same way if you close a single window we would never restore it.
If you use File > Exit the windows will restore properly and that is the intent of the
window.reopenWindowssetting.zaichang commentedon Jul 25, 2017
Benjamin Pasero (@bpasero) Just wanted to thank you for adding this feature, it was one of my biggest gripes with VS Code before since I work with multiple windows some of which has files from different locations. Hunting them down and re-opening them every time VS Code restarts was a pain!
BobbyBabes commentedon Jul 25, 2017
^^
This!
BobbyBabes commentedon Jul 26, 2017
Benjamin Pasero (@bpasero) This is more of a question than an issue.
Situation:
Reopening VSC (as per the title of this issue) works as expected. Both windows are restored with all files.
Ctrl+Q again.
Then double-clicking a source file in the file manager, opens one VSC window with just the double-clicked file.
Ctrl+Q again.
Start VSC from its icon, and one window opened with just the one file (that was double-clicked from the file manager).
I restored the initial 2 windows with Ctrl+N, followed by Open recent.
I had expected that starting VSC from its icon, would first open the 2 VSC windows. And that the source file (double clicked from the file manager) would be added to one of the 2 VSC windows. And that that window would be pushed to the foreground.
Similar to what happens when there are already VSC windows opened, and you then double-click a source file from the file manager.
So my question is : is this intentional, and should I therefore open a request for this behaviour to be added ?
Curros commentedon Aug 9, 2017
Hi everyone, I'm trying to change from Sublime to VS Code so keep the old files is important for me , but I just install the version: 1.15.0-insider, and I'm not able to find the property "window.reopenWindows".
I do have "window.restoreWindows": "all". And of course, is not restoring all the files previously opened.
Benjamin Pasero (@bpasero) any suggestions? (tks in advance!)
bpasero commentedon Aug 11, 2017
BobbyBabes yeah that seems like a separate issue to me, you seem to want to restore your context if you start Code via the icon and ignore sessions where you opened code with a specific file. I think it should be reported as such.
Today we simply restore your last session, no matter how you got there (e.g. by clicking the icon or opening a file).
Angel Curros (@Curros) the setting is now called
"window.restoreWindows": "all". If it does not work please report a new issue with steps how to reproduce.BobbyBabes commentedon Aug 11, 2017
Benjamin Pasero (@bpasero) Thanks for clearing that up. I'm opening a new request issue right after.
aethelberht commentedon Sep 15, 2017
Benjamin Pasero (@bpasero)
Are you saying the current intended behavior is to restore all open editors, both clean and dirty, regardless of whether VS Code is launched by the icon or launched by opening a file? Because it seems to me that the
"window.restoreWindows": "all"setting is only applying to the former.bpasero commentedon Sep 16, 2017
No, when you open a file into a window, then we do not restore the other editors.
Remember all UI state even for empty windows (fixes microsoft#207) (m…