Problem
The settings UI presents a default-shell choice and saves it in renderer localStorage, but the Electron main process never reads that value. Every Windows PTY starts powershell.exe, while terminal context reports the generic value powershell.
This means the advertised cmd and bash choices do not control the spawned terminal, and Windows PowerShell 5.1 is conflated with PowerShell 7.
Evidence
src/components/Settings.tsx:139-145 loads the saved shell only into renderer state.
src/components/Settings.tsx:320 writes the shell only to localStorage.
src/components/Settings.tsx:790-810 presents the choice as the default shell.
src/types.ts:5-10 defines powershell, cmd, and bash, with no distinct PowerShell 7 value.
electron/shellQuote.cjs:11-13 always returns powershell.exe on Windows.
electron/main.cjs:759-776 uses that result for every PTY.
electron/main.cjs:972-983 reports a generic PowerShell terminal context.
README.md:145 advertises PowerShell, cmd, or bash selection.
Proposed work
- Pass a validated shell identifier across the renderer/main boundary or store the selection in the main process.
- Define exact, allowlisted executable mappings for each supported shell.
- Represent Windows PowerShell and PowerShell 7 separately.
- Report the executable recorded in
ptyShells when building terminal context.
- Define migration behavior for the existing saved
powershell value.
Acceptance criteria
- Start with a failing regression test proving that the saved selection does not affect the spawned PTY.
- Selecting cmd, Windows PowerShell, PowerShell 7, or bash changes the next spawned PTY.
- Missing executables produce an actionable error instead of silently changing hosts.
- Terminal context reports the executable used by that PTY.
- Tests cover selection, saved-value migration, missing executables, and quoting for both PowerShell hosts.
Non-goals
- Do not accept arbitrary renderer-provided executable paths.
- Do not replace
node-pty or move terminal work into PowerShell or .NET.
- Preserve the existing safe directory quoting.
Problem
The settings UI presents a default-shell choice and saves it in renderer
localStorage, but the Electron main process never reads that value. Every Windows PTY startspowershell.exe, while terminal context reports the generic valuepowershell.This means the advertised
cmdandbashchoices do not control the spawned terminal, and Windows PowerShell 5.1 is conflated with PowerShell 7.Evidence
src/components/Settings.tsx:139-145loads the saved shell only into renderer state.src/components/Settings.tsx:320writes the shell only tolocalStorage.src/components/Settings.tsx:790-810presents the choice as the default shell.src/types.ts:5-10definespowershell,cmd, andbash, with no distinct PowerShell 7 value.electron/shellQuote.cjs:11-13always returnspowershell.exeon Windows.electron/main.cjs:759-776uses that result for every PTY.electron/main.cjs:972-983reports a generic PowerShell terminal context.README.md:145advertises PowerShell, cmd, or bash selection.Proposed work
ptyShellswhen building terminal context.powershellvalue.Acceptance criteria
Non-goals
node-ptyor move terminal work into PowerShell or .NET.