Skip to content

fix(wsl-mover): no silent stale window after Use on this computer again; log open-pane gaps - #32828

Closed
nwparker wants to merge 8 commits into
nwparker/wsl-mover-move-loss-e2efrom
nwparker/wsl-move-open-pane-fixes
Closed

nwparker wants to merge 8 commits into
nwparker/wsl-mover-move-loss-e2efrom
nwparker/wsl-move-open-pane-fixes

Conversation

@nwparker

@nwparker nwparker commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​206 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​204
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​168 $\color{#cf222e}{\Huge{\mathbf{−}}}$​29 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139

Summary

Stacked on #32789. Behind the internal WSL hosts gate; nothing here is reachable with it off except the new log lines.

Two changes from the awin verify-5 run:

  1. "Use on this computer again" left the window stale (fixed). After a release, main reloads the window so it hydrates the pre-move session. An unsaved file's beforeunload silently vetoed that reload, so the window kept the moved layout, its panes still bound to terminals that no longer run (blank, no input). The renderer now refuses the release while any file is unsaved and names the files; main logs a vetoed reload.
  2. Diagnostics for three failures that only reproduce on Windows. An open pane carried 140 B after 3,000 lines, an open pane reopened at its project root, and a pane stayed "cannot check" after its background job was killed outside it. All three run through wsl.exe (the bridge PTY, the guest /proc probe, the sleep-time shell-folder read), so they can't be reproduced on macOS/Linux. The next awin run logs, per pane: scrollback and screen sizes and whether a folder was read; whether the sleep-time folder read came back empty; and the pane's processes when no shell is found.

Before / after

Before: Use on this computer again with an unsaved file → nothing visible happens, panes go dead. After: a dialog asks to save or close the named files first; nothing is released until then.

Testing

  • wsl-moved-project-use-here.test.ts: new case fails on the old code (the API was called with an unsaved file), passes now.
  • 50 related test files (515 tests), node and web typecheck, oxlint, localization checks pass.

nwparker and others added 2 commits October 23, 2026 10:51
…nsaved

An unsaved file's beforeunload silently vetoed main's reload after a release, so the
window kept the moved layout with panes bound to dead terminals (awin verify-5).
The renderer now asks for those files to be saved first; main logs a vetoed reload.

Co-Authored-By: Claude <[email protected]>
…erdict come from

awin verify-5 saw an open pane carry 140 B after 3,000 lines, reopen at its root, and
stay "cannot check" after its job was killed elsewhere. None reproduces off Windows,
since all three run through wsl.exe; these lines name the gap on the next run.

Co-Authored-By: Claude <[email protected]>
Bash on the bridge reports no folder, so an open pane's checkpoint kept only its
spawn folder and `cd deep/er` reopened at the project root (awin verify-5). The
pause now reads each live pane's shell folder inside its distro before Sleep ends
the shell, and the restore hint prefers it.

Co-Authored-By: Claude <[email protected]>
nwparker and others added 3 commits October 23, 2026 13:28
Cold restore fills scrollbackAnsi from snapshotAnsi for a normal screen, so both
hold the whole buffer; the move concatenated them, carrying every line twice, and
the per-pane cap then kept only the newest ~1,040 of 2,000 lines (awin verify-6).
The move now carries the normal buffer once, as cold restore replays it.

Co-Authored-By: Claude <[email protected]>
…r a relaunch

After an app relaunch, Windows reads a reattached bridge pane's wsl.exe children as
unverifiable, so every live bridge pane stayed "cannot check" and blocked every
move until it was slept (awin verify-6). The gate now asks the distro about panes
Windows cannot observe too; only a pane whose shell the distro also can't find
stays unverifiable. Also formats the earlier commits' tests.

Co-Authored-By: Claude <[email protected]>
…g it

A terminal the runtime rediscovers after a relaunch carries no pane key until a
layout names it again, and the gate read every paneless terminal as unverifiable,
so no move could start after a restart (awin verify-6). The gate and the pause now
take the pane main's PTY bookkeeping binds the terminal to.

Co-Authored-By: Claude <[email protected]>
@nwparker

Copy link
Copy Markdown
Contributor Author

Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept.

@nwparker nwparker closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant