Skip to content

fix: Fix for incorrect strings sent for non-rune keys in Kitty and Wi…#971

Merged
gdamore merged 1 commit intomainfrom
test-keys
Jan 4, 2026
Merged

fix: Fix for incorrect strings sent for non-rune keys in Kitty and Wi…#971
gdamore merged 1 commit intomainfrom
test-keys

Conversation

@gdamore
Copy link
Owner

@gdamore gdamore commented Jan 4, 2026

…n modes

Also included tests covering more of the keyboard protocol cases.

Summary by CodeRabbit

  • Bug Fixes
    • Keyboard input now correctly separates character (rune) keys from non-character keys, preventing stray character data on special keys while preserving characters for rune keys.
  • Tests
    • Tests updated to validate expected character strings for special key cases and improve per-key success/failure reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Differentiates character payload posting for rune vs non-rune keys in Windows and CSI 'u' paths: non-rune keys now post with an empty character string, rune keys post actual characters only when present. Tests updated to assert the new string behavior.

Changes

Cohort / File(s) Summary
Key handling logic
input.go
Updated handleWinKey and handleCsi (case 'u') to post an empty character string for non-rune keys and to post KeyRune with the actual character only when chr != 0. No control-flow or public signatures changed.
Tests
input_test.go
Added expectedStr to TestSpecialKeys cases; assertions now check kev.Str() against expected values; test messages adjusted for per-key success and clearer mismatches; copyright year bumped to 2026.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

Poem

🐰
I nibble keys in moonlit rows,
Runes sing soft where starlight goes,
Silent non-runes keep their part,
Tests hop by and bless the art,
Hooray — input's tidy heart! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing incorrect strings for non-rune keys in Kitty and Win modes, which aligns with the primary modifications in input.go.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82ca1b5 and 80a0969.

📒 Files selected for processing (2)
  • input.go
  • input_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • input.go
  • input_test.go

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.

❤️ Share

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

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.85%. Comparing base (214770c) to head (80a0969).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #971      +/-   ##
==========================================
+ Coverage   76.32%   78.85%   +2.53%     
==========================================
  Files          38       38              
  Lines        3670     3675       +5     
==========================================
+ Hits         2801     2898      +97     
+ Misses        731      638      -93     
- Partials      138      139       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…n modes

Also included tests covering more of the keyboard protocol cases.
@gdamore gdamore merged commit 80a0969 into main Jan 4, 2026
15 checks passed
@gdamore gdamore deleted the test-keys branch January 4, 2026 19:24
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.

1 participant