Skip to content
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

VSCode never remembers my previous session and doesn't reopen the tabs and project after restart. #36964

Closed
mar-ses opened this issue Oct 26, 2017 · 16 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) linux Issues with VS Code on Linux windows VS Code on Windows issues workbench-state UI state across restarts
Milestone

Comments

@mar-ses
Copy link

mar-ses commented Oct 26, 2017

  • VSCode Version: 1.17.2
  • OS Version: Ubuntu 14.04 LTS

Steps to Reproduce:

Can't reproduce it myself (on another computer with same extensions, settings and version (1.17)

Summary: Every time I open VSCode after computer shutdown, it fails to reopen my previous window. This includes the previous tabs, and the previously open project. Instead it always opens the same project that I opened with (in Explorer) a long time ago, and with only the Welcome tab and the User Settings tab.

  1. Relevant settings:

"window.restoreWindows": "all", "window.openFoldersInNewWindow": "off"

Relevant extensions: Project Manager

  1. I open vscode, and the current tabs are the Welcome and User Settings. The project that is loaded is an old project I opened once with Explorer. I open a new project in a new window (either with Project Manager, or by opening a new window and selecting a new project with the Explorer).

  2. I open a bunch of tabs from that project (and tabs that aren't in that project). If I close VSCode now and reopen it, the tabs, project and everything comes back as expected.

  3. If I restart my computer and open VSCode, my previous session is forgotten, and I have the Welcome tab and User Settings tab open, as well as the old project that I'm not interested in.

What I would expect is that with my settings, it reopens the previous session, with all its tabs and the project that was open at the time in Explorer. I have two laptops, this issue only affects one of them. The VSCode versions are 1.17.1 and 1.17.2 but this has happened in previous versions (1.16) as well. The only difference between the computers is that one has Ubuntu 16.10, the other (the one where the issue strikes) has Ubuntu 14.04 LTS.

Reproduces without extensions: Yes and No (see comment below). Opening without extensions fixed the problem of VSCode opening with the old project, as it now restores the correct project. However it doesn't restore the old tabs.

@mar-ses
Copy link
Author

mar-ses commented Oct 26, 2017

Was checking whether it reproduces without extensions, here's the result:

When I opened code with code --disable-extensions it doesn't reopen my tabs, however now at least the project restored (it didn't open the old project that it was usually opening, but the one I had on last time). This seems to work now when I open with extensions too, however the tabs still don't restore in both cases.

@bpasero bpasero assigned Tyriar and unassigned isidorn Oct 26, 2017
@bpasero
Copy link
Member

bpasero commented Oct 26, 2017

@Tyriar this sounds a lot like the issue on Ubuntu 17.10 with the task bar shortcut.

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Oct 26, 2017
@Tyriar
Copy link
Member

Tyriar commented Oct 29, 2017

@mar-ses are you using Ubuntu Gnome?

@Tyriar Tyriar added linux Issues with VS Code on Linux info-needed Issue requires more information from poster labels Oct 29, 2017
@mar-ses
Copy link
Author

mar-ses commented Oct 29, 2017

I'm using Ubuntu Unity.

@Tyriar Tyriar removed the info-needed Issue requires more information from poster label Oct 30, 2017
@Tyriar Tyriar added this to the Backlog milestone Oct 30, 2017
@bpasero bpasero added workbench-state UI state across restarts and removed workbench labels Nov 16, 2017
@ghost
Copy link

ghost commented Feb 6, 2018

@bpasero Is there any fix for that issue you mentioned? I think I have it too. I'm using VS Code 1.19.3, running on Arch Linux + GNOME, and it will never remember my previous session if I open it through the shortcut, but it does if I invoke it through the console. I also have "window.restoreWindows": "all" set, and I'm using the default .desktop file provided in the AUR package which is this: https://aur.archlinux.org/cgit/aur.git/plain/code.desktop?h=code

Edit: the session is restored via the shortcut only if I leave a file with unsaved changes. Via the console, it is always restored regardless of whether the changes were saved or not. So I'm leaving a dummy file with unsaved changes as a workaround for the time being. :/

@mar-ses
Copy link
Author

mar-ses commented Feb 7, 2018

One thing that happens for me is that I often modify files on two different machines, with the files kept synced automatically (i.e with something like MEGA/Dropbox etc...). If modify a file on one machine that was previously opened on the second machine, then when I try to reopen my session on the second machine, it won't reopen that file.

That's actually one thing that I preferred in Sublime Text, it never had any issues reopening files, even if they had been modified and synced from another machine, and even if they were currently open it seemed to be able to update them or something if I'm not misremembering.

Is this something that can be configured in VSCode? If not, I feel like it would be a useful addition. Perhaps not necessarily being able to modify and sync the files while they are simultaneously open on two machines, but at least so that if I modify them on one machine, the other machine will be able to reopen it (if it had been open on there previously of course).

Also, I can't tell if this issue ended up being fixed for me, or if I just got around it by starting to use the in-built Workspaces.

@nurp
Copy link

nurp commented Mar 26, 2018

I am on Windows and have same problem. Workspace is not restored after I restart Windows. The project loads but all the tabs that were open before is now closed. Only happens if I restart windows. The project resides on a linux server, not local on Windows. Wonder if that's related.

@nurp
Copy link

nurp commented May 4, 2018

It also never re-opens my tabs after an update restarts vscode. It always opens one tab that shows release notes. This is soooo annoying as updates are very often.

@Tenemo
Copy link

Tenemo commented May 17, 2018

Same issue, it sometimes does it sometimes not, I can't find any specific trigger for it. Randomly, once in ~10 launches, VSC forgets every file open and disabled extensions. User settings are in place though.

@RoyalBingBong
Copy link

Steps to Reproduce:

  1. Start Code
  2. Open a bunch of files
  3. Close Code to save the session
  4. Open Code again
  5. Open additional files
  6. Shut down the PC with Code still open
  7. Start Code
  8. Code will only open the files from step 2.

@enkol
Copy link

enkol commented Jun 13, 2018

I've a similar problem. VSCode opens the last folder on start, but not the opened files. It only shows the Welcome page. This doesn't happen always, sometimes it works like expected (opens last folder and restore files/tabs and even unsaved files).
Im using VSCode on Windows, but my project folder is on a network drive (mapped to a drive letter). I've already started to open explorer first, to ensure the network drive is there and accessable, before i even open VSCode. The problem still happens unpredictably.
I always close VSCode, before shutdown.

Are there any logs i can check, to see why VSCode fails to restore the session?

@ahasbini
Copy link

ahasbini commented Aug 2, 2018

Had the issue with a Blue Screen on Windows 10. VSCode opened the unsaved files however the saved files were not re-opened.

@Gruntfuggly
Copy link

On Windows 7, no network drives or anything.

"window.restoreWindows": "all",
  1. Open vscode
  2. Open folder
  3. Close vscode
  4. Open vscode

Just get the screen saying "Show All Command Ctrl+Shift+P, Open File Ctrl+O, etc..."

@dotSomething
Copy link

Issue also exists on/with:

OS: Win10
VS Code Version:

Commit: 1dfc5e557209371715f655691b1235b6b26a06be
Date: 2018-07-11T15:43:53.668Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64

Enabled Extensions:

VS Code Settings :

{
    "editor.minimap.enabled": false,
    "editor.parameterHints": false,
    "editor.hover.delay": 2000,
    "workbench.startupEditor": "newUntitledFile",
    "workbench.activityBar.visible": false,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "window.menuBarVisibility": "default",
    "editor.renderWhitespace": "all",
    "editor.insertSpaces": false,
    "window.zoomLevel": -1,
    "editor.acceptSuggestionOnEnter": "smart",
    "editor.lineHeight": 20,
    "editor.detectIndentation": false,
    "files.trimTrailingWhitespace": true,
    "window.restoreWindows": "all"
}

@Gruntfuggly
Copy link

I think I know what's going on in my case - it only works if I use Exit from the File menu. Closing all windows doesn't work.

What doesn't help is that there is no default windows keybinding for Exit - I'm used to being able to Ctrl+Q from any app. I've now set one up, and it restores the windows properly.

@Tyriar Tyriar removed their assignment Sep 12, 2018
@Tyriar Tyriar added the windows VS Code on Windows issues label Sep 12, 2018
@bpasero
Copy link
Member

bpasero commented Sep 13, 2018

Closing as duplicate of #12058

@bpasero bpasero closed this as completed Sep 13, 2018
@bpasero bpasero added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 13, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) linux Issues with VS Code on Linux windows VS Code on Windows issues workbench-state UI state across restarts
Projects
None yet
Development

No branches or pull requests