Repository navigation
[0.0.28] fix(input): preserve negotiated Shift+Enter distinction - #2628
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Kitty encoding policy and coverage crates/bitty-platform/src/keyboard.rs, crates/bitty-runtime/tests/enhanced_keyboard_protocol.rs |
Documentation distinguishes legacy and negotiated encoding for modified functional keys. Tests cover Enter, Tab, Backspace, Delete, and numpad Enter across modifier, repeat, release, and report-all cases. |
Pending-paste Enter handling crates/bitty-runtime/src/runtime.rs, crates/bitty-runtime/src/runtime/input.rs, crates/bitty-runtime/src/runtime/selection.rs, crates/bitty-runtime/tests/suspicious_paste.rs, crates/bitty-terminal/src/chrome_keys.rs |
Only an unmodified Enter press confirms a pending paste. The runtime consumes the confirming Enter’s repeat and release, and clears its swallow state on focus loss. Tests cover later Enter input and modified Enter behavior. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant EnterEvent
participant confirm_pending_paste_on_enter
participant PendingPaste
EnterEvent->>confirm_pending_paste_on_enter: unmodified Enter press
confirm_pending_paste_on_enter->>PendingPaste: confirm pending paste
EnterEvent->>confirm_pending_paste_on_enter: repeat and release
confirm_pending_paste_on_enter->>confirm_pending_paste_on_enter: consume through release
Possibly related issues
- bitty-terminal/bitty#2632 — The changes cover Enter press, repeat, release, and Shift+Enter behavior with pending paste, but the issue describes a broader contract and is identified as a separate follow-up.
Suggested labels: area:runtime
Merge Risk: 
Minimal · up to d5ca0
-
No specific regression is established. Complete the required checks and resolve the reported test failures before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the change, the scope, and the type of fix: it preserves the negotiated Shift+Enter distinction in the input path. The PR changes Kitty keyboard encoding and routing for Shift+Enter, so the title matches the main change. The title's "[0.0.28]" version tag and the commit-style prefix are noise but do not make the title unrelated or vague.
Full details: Out of Scope Changes check
-
Explanation
The changes cover Shift+Enter encoding, Kitty negotiation, repeat and release handling, and the real modifier routing path. The paste-confirmation and focus-loss changes prevent modified Enter from confirming or leaking across focus changes. The added tests verify these behaviors. The reported changes have a direct connection to the stated keyboard contract. No unrelated change is demonstrated.
-
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
[guard 2026-10-24 20:15] Forensics (from job steps + annotations, NOT a rerunnable flake): nextest fails on ALL OS legs — Quality gates shard 1/2 (exit 100), Windows/Linux-X11/Linux-Wayland/macOS all fail at Run tests, so both Tier-1 aggregates read stale leaves. Branch-specific test failures (sibling PRs 2630/2631/2567 green in the same window). NEEDS-FIX in-branch; do not merge past red. |
Xuepoo
left a comment
There was a problem hiding this comment.
Guard independent review 2026-10-24 ([guard], cron):
Checks (verified green on head): Quality gates (1) pass, Quality gates (2) pass, Linux X11 (xvfb) pass, Linux Wayland pass, Windows check and test pass, macOS ARM64 pass, MSRV 1.85 pass, Supply chain pass, VM tier pass, Extension pin drift pass.
Diff read: encode_key_event_kitty_protocol narrows the bare Enter/Tab/Backspace/Delete legacy exception to modifiers == 0 (bare_legacy_exception), so Shift+Enter under the negotiated Kitty protocol now emits CSI 13;2u while bare Enter keeps CR; legacy path docs explicitly state Shift+Enter stays CR. Tests added in enhanced_keyboard_protocol.rs cover both paths. Legacy-path behavior is unchanged (UX reference rule satisfied). Approving; branch is behind main — updating branch before merge.
Priority: P1 | Area: area:term | Labels: fix,P1,area:term | Milestone: v0.0.28 | RFC: OQ-004 | Task: CTX-1505
Closes #1665 (related Kitty keyboard protocol contract).
Summary
Some TUIs use Shift+Enter as an inserted newline. This patch makes the Kitty encoder's bare-key fallback explicit and pins the routing contract:
0d);CSI > 1 u/CSI = 1 u), Shift+Enter isCSI 13;2u(1b 5b 31 33 3b 32 75);CSI 13;2:2u/CSI 13;2:3u;ModifiersChangedplatform route is covered.The legacy exception remains for bare Enter/Tab/Backspace/Delete so a crashed application can still type
reset. No modifyOtherKeys path exists in Core; this change does not invent one or alter chrome keymaps/shell routing.Verification
cargo fmt --all -- --checkcargo clippy -p bitty-platform -p bitty-runtime --all-targets --locked -- -D warningsbitty-platformkeyboard tests: 34 passedbitty-runtimeenhanced keyboard protocol tests: 42 passedjust check)Security/performance impact: bounded existing CSI-u frames only; no new authority or unbounded input.
Follow-up: independent review and required CI; do not merge as part of this task.
Summary by CodeRabbit