Repository navigation
Add “Clear terminal buffer” action - #434
Merged
Merged
Conversation
strayge
marked this pull request as ready for review
November 4, 2026 02:21
… skip the alternate screen Review fixes for the Clear terminal buffer action (amirlehmam#434): - Clear ConPTY's own screen copy before xterm's. A frontend-only clear left ConPTY's cursor on the old bottom row, so the next echoed keystroke came back as an absolute CUP to that row. New pty:clear IPC (preload -> PtyManager.clear -> node-pty clear()), accepted only from the window that owns a live PTY; a no-op where node-pty has no clear(). - Re-base, rather than delete, the prompt log's pending OSC 133 A/B state, so the command typed right after a clear at an idle prompt is still logged. - Do nothing on the alternate screen, like Reset terminal state (amirlehmam#357). - Replace the two tests that passed with the feature reverted, and add a real ConPTY test proving the echo lands on the kept row only with clear(). Also clears pre-existing Sonar findings in the touched files (nested ternary and complexity in PtyManager.create, a redundant void, nested callbacks in useTerminal and a test helper). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amirlehmam
force-pushed
the
feat/clear-terminal-buffer
branch
from
November 4, 2026 10:58
1d284e1 to
3809e01
Compare
Owner
|
Thank you, this is a useful action and it was wired the right way: an unbound default, the palette entry, and stored keybindings merged over the defaults, so it reaches existing users. Review found two problems on Windows when you clear at an idle prompt and then type, so I added a commit on top:
Each fix has a test that fails without it. Merging; it ships in the next release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
wmux has no built-in way to clear terminal scrollback without restarting the shell.
Changes
Testing