Repository navigation
fix(session): keep the requested shell spec through a remount - #197
Conversation
setResolvedShellForSurface wrote the resolved executable back into SurfaceRef.shell so the tab could be labelled (e5ec559). But that field is also the surface's respawn spec, and it is persisted: `ssh user@host` became a bare `…\ssh.exe`, was saved that way, and a restored ssh workspace started an ssh with no destination, printed usage and exited. The two consumers wanted different things — PaneWrapper wants the spec, the tab caption wants a name — so give the caption its own field. `shell` is now immutable: whatever the surface was asked to start with. resolvedShell is deliberately not persisted; the PTY reports it again on every spawn, so saving it could only make it stale. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
cd616c3 to
835b189
Compare
|
Merged. Thank you. This is the kind of bug I like seeing fixed properly: the symptom was "restored ssh workspace prints usage and exits", and the tempting fix is a guard at the respawn site. Splitting the field instead — Narrowing I checked the persistence side too — Shipping in v1.12.0. |
…only once the shell is ready (#252, #251) `where` against wmux's OWN PATH. Git for Windows only puts `<Git>\cmd` there, so the lookup either missed (silent fallback to pwsh, a console.warn nobody sees) or hit System32\bash.exe, the WSL launcher. Measured here with PATH rebuilt from the registry (what an Explorer-launched wmux inherits): `where bash.exe` -> System32\bash.exe + the WindowsApps alias, no Git bash. A bare bash/git-bash alias now resolves to Git's bin\bash.exe (via the git.exe on PATH or the default install roots) unless PATH holds a real, non-WSL bash; it gets `--login -i` like every other Git Bash entry point. Verified end to end under node-pty with that PATH: the pane opens MINGW64 in the requested cwd. A spec that still cannot resolve now says so in the pane (shellFallbackFrom). Restore needs no change: SurfaceRef.shell is only set for an explicit choice (resolvedShell carries the display value since #197), so a restored surface without one already spawns the CURRENT default. renderer on a blind 600 ms timer after pty.create, and agent-manager kept its own prompt sniff. PtyManager now owns delivery for every caller (startup-commands.ts): an OSC 133 A/B mark, then a prompt-shaped line, then 1.5 s of quiet output, with a 5 s ceiling on a separate timer. PowerShell with the integration is unchanged (WMUX_STARTUP_COMMANDS, no keystrokes); spawning pwsh 7 exactly as PtyManager does with a stand-in `claude` showed argv `["--resume","<id>"]` intact on every run, env-baked or typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
SurfaceRef.shellas the requested respawn/session-restore specificationresolvedShellThis prevents a shell such as
ssh user@hostfrom becoming a destination-lessssh.exeafter a remount or restore.Validation
npm run typecheckCloses #194