-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remember all UI state even when reopening window without workspace #207
Comments
Fair request. |
+1 |
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. |
@nchammas you can enable restoring of all windows through the |
Oh snap. Good call--that did the job. 👍 |
So if no folders are open, opened files are not reopened after restart VSC? A bit dumb. |
Yes, only if you open a folder we remember all UI state. |
I've been bit by this already several times, as a reload (from an extension update) loses all my non-workspace-associated open files. It's kind of driving me crazy, as extension updates are very frequent. I understand the association with workspaces, but I am also using vscode a lot as a "regular" text editor, calling it up from the cmd line to open files all over my filesystem. It's a fantastic general-purpose editor in addition to a project-oriented IDE, but this issue gets in the way of that usage pattern. Thinking out loud possible solutions: how about having a "mock" workspace, tied to a special internal name (not on the filesystem) that would simply record all open paths as absolute? This would be the "dump bucket" for all other open files, and could be restored as a group. I'd be OK if the restored individual files, on reopen, all get sent to a single window (to avoid the complexities of tracking them per-window). Just a thought. In any case, great job overall with VSCode, I'm loving it! |
Duplicate: #101 |
Right now folder workspaces record the state of the editors in local storage under the Empty workspaces have a similar prefix in local storage: One solution for enabling this is to generate a random hash to be known as the workspace identifier and move the workspace storage to ``storage://workspace/$noWorkspace// Making @bpasero is this the approach you would take? Any details I'm missing about the current situation? /cc @chrmarti (interest) |
Well you take We should also not forget that the majority of users actually likes the fact that the window opens empty. I remember once that I was always restoring the previously opened file (even for empty workspaces) and that caused an outrage by people that hated it. |
Since restoring previously opened files when opening on a folder is accepted as the right thing to do, there should be a large number of users who would prefer the same without opening on a folder. Did removal of that not trigger any reactions? I still feel we don't necessarily understand the not-open-on-folder case well, because we tend to not use it that way. |
@chrmarti The behavior was never present. The use case is simple: remember (all) UI state when opening VSC, independent of the open number of folders/workspaces. |
@chrmarti all I can say is that we once had a bug where we would always reopen the last used file even in the empty workspace case and I got lots of issues for such behaviour. I agree that it is hard to say if that is the majority. Though I must also say that this does not seem one of the highest voted issues so far, so maybe people got used to it. My point is about changing the default behaviour we have today should be a decision with great care. |
@bpasero reopening the last file and not the rest is a little different to restoring the entire state. Here is how some other editors work for this case:
Regardless, we need to support hot exit on empty workspaces as only having it work on folder workspaces would seem like another bug and lead to some weird behavior when you close multiple windows at once when some have no folder opened (some will hot exit, some will prompt). |
This will be available in tomorrows insider. |
@bpasero Is that a newspaper? |
You can give our preview releases a try from: http://code.visualstudio.com/Download#insiders |
@bpasero I was just kidding. The last 2 words sound like a newspaper name. Sorry! Should have added a smilie. |
:] |
@bpasero Should the old setting be honored if it is set? I have |
@chrmarti great catch, I had a bug in my migration code 👍 |
Hi @bpasero. Just double checking, in the insiders preview looks like the new option is 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 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. |
Another problem is that I'm not getting the expected behavior with: {
"window.restoreWindows": "all",
"files.hotExit": "onExitAndWindowClose"
} 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. |
@aaccioly can you file this as separate issue, it seems unrelated. |
Hi @bpasero, ok, will do. |
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 |
@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! |
^^ |
@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. Then double-clicking a source file in the file manager, opens one VSC window with just the double-clicked file. 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. 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". @bpasero any suggestions? (tks in advance!) |
@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). @Curros the setting is now called |
@bpasero Thanks for clearing that up. I'm opening a new request issue right after. |
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 |
No, when you open a file into a window, then we do not restore the other editors. |
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.
The text was updated successfully, but these errors were encountered: