fix(tui): pass through Ctrl/Cmd+L so the dashboard redraw byte never inserts a stray 'l' - #87070
Closed
jazzzzmaybe wants to merge 5 commits into
Closed
jazzzzmaybe wants to merge 5 commits into
jazzzzmaybe wants to merge 5 commits into
Conversation
The dashboard PTY forced HERMES_TUI_INLINE=1 while xterm.js tried to scroll an empty host scrollback buffer. Inline mode leaves the transcript ScrollBox unbounded, so PageUp/wheel had nothing to scroll and only the last few rows were visible. Stop forcing inline mode so AlternateScreen bounds the viewport, route browser wheel into Shift+Up/Down key sequences over the PTY, and keep burst collapse in the resume sanitizer without stripping erase codes.
…inserts a stray 'l' The dashboard PTY reattach path writes a raw Ctrl-L (0x0c) into the PTY to force a full TUI repaint (TUI_FORCE_REDRAW in pty_session.py). The Ink keypress parser turns that byte into a ctrl+l key event, which the global hotkey handler consumes for the redraw but does not stop propagating, so the composer's TextInput also receives it and inserts a literal 'l' into the input box on every session switch. Route ctrl/cmd+l through the existing pass-through predicate so the composer ignores the redraw keypress (matching the global handler's own isAction(key, ch, 'l') check) while unmodified 'l' still types.
Contributor
fix(tui): pass through Ctrl/Cmd+L so the dashboard redraw byte never inserts a stray 'l'
|
Author
|
Superseded by a clean single-commit PR from the fix/ctrl-l-redraw branch. This PR's branch mixed in personal fork CI changes; sorry for the noise. |
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.
Summary
Fixes #87069 — the dashboard Chat tab inserted a stray
linto the composer on every session switch.Root cause:
PtySession.attach()injects a raw Ctrl-L byte (0x0c) to force a TUI repaint on keep-alive PTY reattach (#86332 / #68071). The Ink keypress parser maps that byte to actrl+lkey event which reaches both listeners — the global hotkey handler (which redraws but doesn't stop propagation) and the composer'sTextInput, which falls through to the generic insert branch and types a literall.Change
One line: add
isAction(key, input, 'l')toshouldPassThroughToGlobalHandlerso the composer ignores the redraw keypress, mirroring the global handler's ownisAction(key, ch, 'l')check inuseInputHandlers.ts. Unmodifiedlstill types normally; the existing ctrl+c/x/o pass-through entries are untouched.Test plan
cd ui-tui && npx tsc --noEmitcd ui-tui && npx vitest run src/__tests__/textInputPassThrough.test.ts(7 passed)cd ui-tui && npx vitest run src/__tests__/textInput(107 passed)l; typinglnormally is unaffected.Related