Skip to content

fix(input): preserve shift in kitty alternate reports - #2479

Merged
ogulcancelik merged 1 commit into
masterfrom
issue/2435-key-encoding-architecture
Aug 7, 2026
Merged

fix(input): preserve shift in kitty alternate reports#2479
ogulcancelik merged 1 commit into
masterfrom
issue/2435-key-encoding-architecture

Conversation

@ogulcancelik

Copy link
Copy Markdown
Collaborator

Summary

  • normalize Kitty shifted-alternate reports that omit the Shift modifier
  • preserve the original VT bytes while preventing the unshifted prefix action from dispatching
  • cover the exact WezTerm sequence in the protocol corpus and end-to-end prefix dispatch

Validation

  • just check
  • macOS WezTerm with enable_kitty_keyboard = true: prefix+shift+r returns to terminal mode and subsequent text reaches the pane

Refs #2435

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fcdc005-ed79-477c-a5be-43f97a3e3a07

📥 Commits

Reviewing files that changed from the base of the PR and between e18aac1 and 879149a.

📒 Files selected for processing (1)
  • docs/next/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/next/CHANGELOG.md

📝 Walkthrough

Walkthrough

The Kitty keyboard parser infers omitted Shift modifiers from distinct shifted codepoints. A Prefix-mode regression test verifies shifted reload dispatch and the return to terminal mode. The changelog documents the fix.

Changes

Kitty Shift handling

Layer / File(s) Summary
Infer omitted Shift modifiers
src/input/parse.rs
Kitty character keys receive SHIFT when a distinct shifted codepoint is present. Tests cover press, repeat, release, and fallback cases.
Verify Prefix reload dispatch
src/app/input/navigate.rs, docs/next/CHANGELOG.md
A regression test verifies shifted reload handling in Prefix mode. The changelog records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • herdrdev/herdr#2259: Both PRs address Shift preservation in Kitty or terminal input handling through different parsing and conversion paths.

Suggested labels: coderabbit-review

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the input fix that preserves Shift in Kitty alternate reports.
Description check ✅ Passed The description directly explains the Kitty input fix, regression coverage, and validation results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/2435-key-encoding-architecture

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 88b58541-4443-41d5-ba0b-56f84c93a949

📥 Commits

Reviewing files that changed from the base of the PR and between 79a953e and 96468c3.

⛔ Files ignored due to path filters (1)
  • tests/fixtures/keyboard_protocol_corpus.tsv is excluded by !**/*.tsv
📒 Files selected for processing (3)
  • docs/next/CHANGELOG.md
  • src/app/input/navigate.rs
  • src/input/parse.rs

Comment thread src/app/input/navigate.rs
@ogulcancelik
ogulcancelik force-pushed the issue/2435-key-encoding-architecture branch from 96468c3 to e18aac1 Compare August 7, 2026 13:14
@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown

Greptile Summary

The PR normalizes Kitty keyboard reports that provide a shifted alternate while omitting the Shift modifier, preserving shifted prefix-command dispatch.

  • Adds Shift normalization during Kitty sequence parsing.
  • Adds parser, protocol-corpus, and prefix-dispatch regression coverage.
  • Documents the corrected WezTerm behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/input/parse.rs Normalizes omitted Shift modifiers in Kitty alternate reports and adds focused parser regression coverage.
src/app/input/navigate.rs Adds an end-to-end prefix-dispatch test confirming the WezTerm sequence selects reload rather than the unshifted resize action.
tests/fixtures/keyboard_protocol_corpus.tsv Adds the exact omitted-Shift Kitty sequence to the protocol corpus.
docs/next/CHANGELOG.md Documents the corrected shifted prefix-key behavior in WezTerm Kitty mode.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[WezTerm Kitty VT sequence] --> B[Parse base and shifted codepoints]
  B --> C{Distinct valid shifted alternate?}
  C -->|Yes| D[Add Shift modifier]
  C -->|No| E[Keep reported modifiers]
  D --> F[Prefix binding resolution]
  E --> F
  F --> G[Dispatch selected action]
Loading

Reviews (2): Last reviewed commit: "fix(input): preserve shift in kitty alte..." | Re-trigger Greptile

@ogulcancelik
ogulcancelik force-pushed the issue/2435-key-encoding-architecture branch from e18aac1 to 879149a Compare August 7, 2026 16:01
@ogulcancelik
ogulcancelik merged commit b0723b7 into master Aug 7, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants