Repository navigation
Sonny composer: Shift-Enter starts a line; mouse selection to type over or delete - #297
Conversation
… to type over or delete Sonny matched Shift-Enter but never asked the terminal to report it, so it arrived as a plain Enter. It now pushes the kitty keyboard protocol's flags as Codex does (unambiguous escape codes, alternate keys, no release events) and pops them on the screen each push was made on: main, alternate, and around a side chat. On the full screen the composer takes the mouse, as Codex's does: a click places the cursor, a drag selects and copies, two clicks select a word and three a line. Typing replaces the selection, Backspace/Delete delete it, Ctrl-W/U/K cut it for Ctrl-Y, Left/Right go to its ends, Esc lets go, and Ctrl-C copies it rather than discarding the draft. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD6xFctbdWaQRSN9Ab
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f968d8501c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A press that moves the cursor can scroll a long draft; the release then resolved against the new rows and selected the lines between. The gesture now keeps the composer's drawn place from the press until the release. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD6xFctbdWaQRSN9Ab
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f4b09cef1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A drag on a long draft scrolled the composer to follow the cursor, so the pointer moved over other text than it selected. The composer now draws from the row the press found until the release. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD6xFctbdWaQRSN9Ab
What changed
Shift-Enter. The composer already matched Shift-Enter, but Sonny never asked the terminal to report it, so it came in as a plain Enter. Sonny now asks for the kitty keyboard protocol the way Codex does (
codex-rs/tui/src/tui/keyboard_modes.rs): unambiguous escape codes plus alternate keys, and no release events (CSI > 5 u). The main and alternate screens each keep their own stack, so every push is popped on the screen it was made on: at startup and exit, inown_screenwhen switching to or from the full screen, and around a side chat. Herdr passes this through, since it tracks each pane's kitty flags and encodes keys with Ghostty's encoder. A terminal that doesn't know the protocol ignores it, and Alt-Enter and Ctrl-J still work there.Selecting in the composer works on the full screen, like Codex's composer (
bottom_pane/textarea/mouse.rs):The selection lives in
prompt::Promptas ananchorthat runs to the cursor. The draw records where the composer's rows are, so a click can find its character even when the composer is scrolled.Testing
cargo test -p sonny: 317 passed. New tests cover typing over and deleting a selection, moving off it, finding the clicked character, word and line, and an app test for Shift-Enter followed by drag, Backspace, double-click and typing.cargo clippyandcargo fmtare clean.sonnyin a pty against a local daemon and rendered the screen.CSI 13;2ustarted a new line. Dragging over "two" and pressing Backspace leftone three. Double-clicking "three" and typing replaced it. Pushes and pops balanced (3 of each).