Skip to content

Bug: Closing the window to the background corrupts the saved session (right panes dropped, or tab list emptied) #19101

Closed as duplicate

Description

@WalterWhite-1911

Description

With "Continue where you left off" and "Leave app running in the background when the window is closed" both enabled, closing the window (so the app parks in the background) corrupts LastSessionTabList:

  • If the restored tabs have not been displayed since start-up, the tabs are kept but every RightPaneNavPathParam is emptied, so dual-pane tabs come back single-pane.
  • If the tabs have been displayed, the list is overwritten with a single empty entry, [""]; reopening shows only one Home tab.

With "Leave app running" off, closing the window saves the session correctly in both cases (tested with the same 8 dual-pane tabs, displayed and not displayed).

Likely cause (v4.3)

Window_Closed saves the session first (App.xaml.cs ~L308, AppLifecycleHelper.SaveSessionTabs()), then the background path unloads and clears all tabs (~L370-371). Unloading the tabs appears to raise navigation events whose handler in MainPage.xaml.cs (~L189) calls SaveSessionTabs() again after AppInstances has been cleared, so DefaultIfEmpty() yields [""] (or partially unloaded tabs lose their right pane).

Steps To Reproduce

  1. Enable "Continue where you left off" and Settings > Advanced > "Leave app running in the background when the window is closed".
  2. Open several tabs in dual-pane mode with different right panes; restart Files so the session is restored.
  3. Close the window immediately: in user_settings.json the right panes are now empty.
  4. Restore the session again, click through all tabs, then close the window: LastSessionTabList is [""]; reopening Files shows a single Home tab.

Files Version

4.3.0.0 (Stable, sideload)

Windows Version

10.0.19045.7417

Activity

  1. Josh65-2201 commented on Nov 4, 2026

    @Josh65-2201
    Member

    AI issue, likely #19098

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions