Feature Description
Support an intuitive way to insert newlines in the TUI on terminals where Shift+Enter cannot be distinguished from Enter.
Problem
On macOS iTerm2 with default settings, Shift+Enter sends the same byte sequence (\r) as Enter. As a result, pressing Shift+Enter submits the prompt instead of inserting a newline.
Ctrl+J can insert a newline, but it is not intuitive or easily discoverable for multi-line input.
This is a common interaction supported by Claude Code, Warp, and OpenAI Codex CLI.
Steps to Reproduce
- Open iTerm2 on macOS with default settings.
- Run
cmd.
- Type a partial message.
- Press Shift+Enter.
- The prompt is submitted instead of inserting a newline.
Expected Behavior
- Enter submits the prompt.
- Shift+Enter inserts a newline where supported by the terminal.
- Users should have an intuitive way to insert newlines on terminals where Shift+Enter cannot be distinguished from Enter.
- Ctrl+J should continue to work.
Environment
- macOS
- iTerm2 with default settings
- No Kitty keyboard protocol / CSI-u
Use Case
Multi-line prompts are useful for detailed instructions, code snippets, structured requests, and prompts containing multiple paragraphs. An intuitive newline shortcut makes composing these prompts significantly easier.
Additional Context
The issue is caused by the terminal's input encoding rather than a configurable iTerm2 shortcut: Shift+Enter and Enter are both received as \r.
A similar terminal compatibility issue and newline interaction has been addressed by hermes-agent:
NousResearch/hermes-agent#44115
How important is this to you?
Nice to have
Feature Description
Support an intuitive way to insert newlines in the TUI on terminals where Shift+Enter cannot be distinguished from Enter.
Problem
On macOS iTerm2 with default settings, Shift+Enter sends the same byte sequence (
\r) as Enter. As a result, pressing Shift+Enter submits the prompt instead of inserting a newline.Ctrl+J can insert a newline, but it is not intuitive or easily discoverable for multi-line input.
This is a common interaction supported by Claude Code, Warp, and OpenAI Codex CLI.
Steps to Reproduce
cmd.Expected Behavior
Environment
Use Case
Multi-line prompts are useful for detailed instructions, code snippets, structured requests, and prompts containing multiple paragraphs. An intuitive newline shortcut makes composing these prompts significantly easier.
Additional Context
The issue is caused by the terminal's input encoding rather than a configurable iTerm2 shortcut: Shift+Enter and Enter are both received as
\r.A similar terminal compatibility issue and newline interaction has been addressed by hermes-agent:
NousResearch/hermes-agent#44115
How important is this to you?
Nice to have