Skip to content

fix(tui): add shift+enter to InsertNewline key binding, with test#2425

Merged
esengine merged 2 commits into
esengine:main-v2from
JimmyDaddy:fix/shift-enter-newline
May 31, 2026
Merged

fix(tui): add shift+enter to InsertNewline key binding, with test#2425
esengine merged 2 commits into
esengine:main-v2from
JimmyDaddy:fix/shift-enter-newline

Conversation

@JimmyDaddy

Copy link
Copy Markdown
Contributor

What

`InsertNewline` binding now includes `shift+enter` (was only `alt+enter` and `ctrl+j`).

Why

Shift+Enter for newline is standard TUI behaviour. The existing comment already expresses the intent (Enter=submit, modifier+Enter=newline), but Shift+Enter was simply missed from the key list.

Test

`TestInsertNewlineKeyBinding` verifies `shift+enter` appears in the binding's keys.

Note

Only works when the terminal actually distinguishes Shift+Enter from Enter (Kitty, WezTerm, iTerm2 with config). Terminals that don't (macOS Terminal.app, VS Code) are unchanged — use Alt+Enter or Ctrl+J instead.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label May 31, 2026
@esengine esengine force-pushed the fix/shift-enter-newline branch from 732a8e6 to 4f781c3 Compare May 31, 2026 15:10
JimmyDaddy and others added 2 commits May 31, 2026 08:22
Shift+Enter now inserts a newline alongside Alt+Enter and Ctrl+J.
Terminals that don't distinguish Shift+Enter from Enter (macOS
Terminal.app, VS Code) are unchanged — use Alt+Enter or Ctrl+J there.
The original test built its own textarea + binding and asserted shift+enter
was present — tautological (it checked the keys it had just set). Now it
constructs the real chatTUI via newChatTUI and asserts on m.input's actual
binding, so it catches a regression that drops shift+enter from the constructor.
@esengine esengine force-pushed the fix/shift-enter-newline branch from 4f781c3 to cf99303 Compare May 31, 2026 15:23
@esengine esengine merged commit f3f7835 into esengine:main-v2 May 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants