Skip to content

Window state not preserved on session end (shutdown/logout) on Linux: only one window restored #3061

Open

Description

@SatoshiMota

Does this issue occur when all extensions are disabled?: [Yes/No]

  • VSCodium Version: 1.135.06055
  • OS Version: Arch Linux, KDE Plasma, KWin, Wayland session

Steps to Reproduce:

  1. Open many VS Code windows (e.g. 3), each with a different folder/workspace.
  2. Shut down (or log out) from the KDE Plasma menu, without closing VS Code manually.
  3. Boot the PC and start VS Code.

Expected: all windows that were open at shutdown are restored (window.restoreWindows = all), the same as on Windows.

Actual: only ONE window is restored (the others are lost).

Comparison with Windows:

On Windows the same scenario works: with many windows open, after shutdown/restart and starting VS Code again, all windows are restored.

On Linux, if I quit VS Code manually first (File > Exit / Ctrl+Q), all windows are restored correctly. The problem only appears when the session ends while the windows are still open. Or when closing an application in the taskbar at the bottom in Linux (obviously, the system does not send to close the application, but each window).

Hypothesis (not verified in the code):

On Windows the OS signals session end, and Electron/VS Code treats it as quitting the whole app, so the full window state is saved. On Linux, the desktop session manager (KDE/Plasma) just asks each window to close. VS Code seems to handle these as individual window closes, so each window gets removed from the saved state, and only the last one remains.

Question/request: can VS Code treat session end (logout/shutdown requested by the desktop environment, e.g. via SIGTERM or the compositor's close requests for all windows) as a quit, so the state of all windows is preserved on Linux too?

Current workaround: force-kill the process before Plasma starts closing windows, or press Ctrl+Q manually before every shutdown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions