The TUI prompt input should remain readable while the user drafts long prompts.
Long text wraps inside the input box instead of horizontally scrolling away, and
users can insert intentional line breaks with Shift+Enter.
Enter submits the current prompt when the normal input box is focused.Shift+Enter inserts a newline into the draft without submitting.Ctrl+C clears the whole prompt draft when the input box has content. With an
empty prompt draft it falls through to the protected double-press TUI exit
flow defined in turn-cancellation.md.Up and Down continue to navigate input history when the draft is empty or
already in history-navigation mode, including while model output is streaming
and a submitted prompt would be queued. While the user is editing non-history
draft text, Up and Down are left to the multiline editor for cursor
movement across wrapped or explicit lines.The prompt surface uses the OpenTUI textarea renderable rather than the single-line input renderable. The textarea owns cursor movement, word wrapping, scrolling, paste handling, and newline insertion. The TUI component owns only the controlled draft synchronization and submit intent.
The renderer must not move draft ownership into component-local state. The canonical draft remains the React/TUI session state used by slash suggestions, attachments, history recall, sidebar metadata, and submission.
The composer computes the current visible editor row count from the draft text
and available content width, clamps it to 2..6, and applies the same height
contract to the textarea. The bordered container also reserves the single
composer status line defined by tui-input-session-panel.md inside its lower
content row, with any spare vertical space placed between the textarea and that
status line. The textarea still owns its internal viewport and scroll offset
once the draft exceeds six visible rows.
2..6 visible rows, and key bindings for Enter submit plus
Shift+Enter newline.Ctrl+C clears a non-empty draft without exiting, and
keeps empty-input Ctrl+C on the double-press exit guard.