On Windows magpie lists the running distros and probes each one for agents,
their sessions and Claude Code. Etsuya233 asked for a way to turn that off.
settings.NoWSLAgents (per machine, kept by KeepOwn) now gates every
auto-discovery path: agent.wslAgents/wslHomes/WSLRunning, sessions'
wslFiles/wslDirs (via the new sessions.WSLOff hook), and wslrun.Find, which
the Claude subscription uses to run Claude Code in WSL. The toggle is shown on
Windows only and is on by default.
Verified:
- red without the change: TestWSLDetectionOff (1 WSL agent with detection
off; with only sessions reverted, a distro's session is listed),
TestFindWithDetectionOff (Find returned Ubuntu after asking wsl.exe).
- go test -tags nogui ./... in a sandbox HOME: every package ok except
TestPluginLoginTakesTheLapseOff, which timed out at 63.7s under the full run
and passes alone (-count=3) and with its package (-count=1); it doesn't
reach WSL.
- go vet -tags nogui on agent, wslrun, sessions, settings and gui for darwin,
linux and windows.
- GUI: wsl-agents-setting (en/zh/zh-TW/ja/de, 900 and 440px) 30/30;
gui-ja, gui-de, gui-zh-tw, i18n-keys, keep-awake, lightweight,
settings-sections, settings-groups 44/44 in Chromium and 44/44 in WebKit.
- Windows box (10.0.0.132), nogui magpie.exe in a sandbox profile with a
logging wsl.exe first on PATH: on, `magpie agents` listed Claude Code · WSL
magpie-desktop after 3 wsl.exe calls; off, `agents`, `ls` and `sessions`
made no wsl.exe call and wrote no wsl.json.
Not tried: the toggle in the real Windows GUI window, and Claude Code in WSL
through the Claude subscription with the setting off (unit-tested only).
On a MacBook the window had last been zoomed. magpie skipped a maximised
window when it saved the size, so it reopened at an older, nearly full
size: 1712×1083 at (8,34) on a 1728×1084 work area, neither full nor the
size it was given nor the default.
settings.WindowMaximised (this computer's own, KeepOwn) now records
whether the window was maximised when it settled; Window stays the size
it restores to (settle). A window not shown yet, let go, full screen or
minimised, or on Linux hidden, records nothing.
Reopened maximised: on the Mac and Windows placeMain maximises the made
window just before its first Show (on Windows once its page has come);
Wails' StartState is undone by the Mac's centring and shows a Windows
window before its page. The least size Maximise drops is put back. On
Linux makeMain sets StartState, since GTK can't be asked about a window
not mapped yet.
A size kept on a larger screen: Windows fits the window to the work area
and centres it, title bar in reach, and keeps the larger size for the
larger screen (fitted); the Mac fits and zooms it itself, and magpie
doesn't zoom it again, so it can still be restored.
TestSettle fails with upstream's rule (5 of 9 cases); TestOpenSize,
TestFitRoom, TestWindowMaximisedKeptAndOwn; the Mac's real build under a
sandbox HOME, 11 cases.