[Bug] Shift+Enter scrambles a multi-line message instead of adding a line
Description
Shift+Enter is the multiline shortcut most modern terminals actually send (kitty, WezTerm, Ghostty, iTerm2 in CSI-u mode) but it corrupts the message instead of adding a line break. Ctrl+J, the other documented multiline shortcut, works correctly because it takes a different, cursor-aware code path.
Parent: #907
Steps to Reproduce
- In the composer, type
one, press Shift+Enter, typetwo, press Shift+Enter, typethree. - Submit the message.
Expected Behavior
A three-line message: one, two, three.
Actual Behavior
The words fuse onto one line with stray trailing newlines submitted as onetwothree\n\n.
Recording
Root Cause
source/components/user-input.tsx:863-867 — updateInput(input + '\n') always appends the newline at the END of the string regardless of cursor position, and the TextInput cursor is never moved to match. Each subsequent word gets typed at the stale cursor position instead of after the newline.
Suggested Fix
Route Shift+Enter through the same cursor-aware insert Ctrl+J already uses.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs on the latest
main
Hey @akramcodez ! I’d like to work on this one could you assign it to me?