fix(tui): preserve Ctrl+J newline in VTE terminals - #51546
Conversation
There was a problem hiding this comment.
Pull request overview
Preserves Ctrl+J as a newline chord in VTE-based terminals (e.g., GNOME Terminal/Console) by extending the TUI composer’s terminal fingerprint detection, with a regression test to prevent the Ubuntu/VTE behavior from reappearing.
Changes:
- Detect VTE terminals via
VTE_VERSIONinshouldPreserveCtrlJNewline()to treat bare LF (\n) as an insert-newline chord rather than submit. - Add a Vitest regression case covering a VTE-like environment (
TERM=xterm-256color,VTE_VERSIONset). - Retain the existing “no fingerprint” fallback behavior (bare POSIX terminals keep
Ctrl+Jsubmitting).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui-tui/src/components/textInput.tsx | Adds VTE_VERSION fingerprint to preserve Ctrl+J newline handling. |
| ui-tui/src/tests/textInputPassThrough.test.ts | Adds regression coverage for VTE environments and keeps the bare-POSIX fallback test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the triage. To clarify scope: this PR fixes the TypeScript TUI renderer path in I saw the related PR #52102, which addresses the Python CLI predicate in Happy to do whichever maintainers prefer:
My preference is to keep both layers covered, since VTE detection seems relevant in both input paths. |
|
Thanks for the focused TUI fix. Current main still lacks a The target files are unchanged from the PR's merge base through current HEAD ( Automated hermes-sweeper review. |
Summary
Ctrl+Jas a newline chord in VTE-based terminals by detectingVTE_VERSIONFixes #51545.
Verification
npm test -- --run src/__tests__/textInputPassThrough.test.tsnpm run typechecknpm run buildCtrl+Jrenders a two-line composer input whileEnterremains submit