fix(terminal): swallow Shift+Enter keypress so it no longer submits

xterm runs the custom key handler for keypress too and drops Ctrl/Alt
keypresses but not Shift-only ones, so the stray \r submitted the prompt
after the newline. Swallow every event type for Shift/Ctrl+Enter and send
only on keydown, in the primary pane and Pane B. Adds a static guard and a
real xterm + Chromium browser test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Devvyn
2026-10-02 19:44:58 +08:00
co-authored by Claude Sonnet 5.5
parent 9240493c43
commit c9a5fdab00
6 changed files with 124 additions and 10 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"aicodeman": patch
---
Shift+Enter no longer submits the prompt after inserting the newline. The terminal key handler swallowed only `keydown`, so xterm's `keypress` for Shift+Enter (which, unlike Ctrl/Alt, it does not discard) still sent a bare `\r`.