Repository navigation
Description
What happens
Since #347 (2.40.0), Reset terminal state (Ctrl+Shift+R) leaves the alternate screen only when the pane's shell has reported it is back at its prompt (shellOwnsScreen in src/renderer/utils/terminal-reset.ts, used by the wmux:reset-terminal handler in useTerminal.ts). No report at all counts as "keep the alternate screen".
Only wmux's PowerShell integration sends that report in a local pane. These never do:
- cmd: its integration emits OSC 9 and OSC 133 A/B only
- Git Bash: wmux doesn't load
wmux-bash-integration.shinto a local pane - WSL: wmux exports
WMUX_INTEGRATION=1into the distro but installs no rc hook (see the note insrc/shared/paths.ts) - PowerShell without the integration script
- SSH sessions and nested shells, where the outer PowerShell last reported
runningfor thessh/wsl/pwshcommand and nothing reports the inner prompt
In all of these, the reset can no longer do what #175 added it for. A fullscreen program that dies without sending ESC[?1049l leaves the pane stuck on the alternate screen, and Ctrl+Shift+R now resets the other modes but leaves it there. Scrollback stays unreachable, there's no way to force the exit, and nothing says why.
A smaller case: in PowerShell, running is reported only from the integration's PSReadLine Enter handler. Without PSReadLine, or if a module rebinds Enter after the integration loads, the state reads idle while vim or Claude Code runs, so the #347 problem itself comes back there.
Steps to reproduce
Found by reading the code at v2.40.0. I haven't reproduced it in the app. Expected reproduction:
- Open a Git Bash or cmd pane.
- Simulate a program that dies on the alternate screen. In Git Bash:
printf '\e[?1049h\e[H'; echo STUCK - The prompt comes back on the alternate screen, with no scrollback.
- Press
Ctrl+Shift+R. - Expected: the pane returns to the normal screen with its scrollback, as in 2.39.0. Likely actual: it stays on the alternate screen.
Possible fixes
- Use an in-band signal. An OSC 133;A (prompt start) that arrives while the active buffer is the alternate one means a shell is prompting there, so whatever entered it is gone. xterm already parses these marks for the prompt log. wmux's PowerShell, cmd and bash integrations emit them, and so do third-party integrations, including on remote hosts. This doesn't depend on
runningbeing reported, so it also covers PowerShell without PSReadLine. - Add a way to force it for panes with no integration at all, for example a second
Ctrl+Shift+Rwithin a few seconds, or a palette entry "Reset terminal state (leave alternate screen)". Show a short notice when the reset kept the alternate screen, so the user knows the second press exists.
wmux version
2.40.0
Anything else
Related: #347 (the fix that introduced this), #175 (what the reset is for), #345.
Activity
fix(terminal): ignore key auto-repeat for Reset terminal state
fix(terminal): end the reset's force window when the alternate screen…
fix(terminal): keep the alternate screen while a command started on i…
fix(terminal): ignore a remount snapshot's replayed alternate-screen …
test(terminal): pin the reset's alternate-screen tracking against a r…
fix(terminal): keep the reset notice's live region mounted
docs: note the reset notice overlay and the prompt-mark consumer
fix(terminal): let Ctrl+Shift+R leave a dead program's alternate scre…
amirlehmam commentedon Oct 25, 2026
Shipped in v2.41.0.
fix(terminal): clear ConPTY with the buffer, keep the pending prompt,…
feat(terminal): add a Clear terminal buffer action (#434)