Skip to content

fix: recognize kitty CSI-u codepoints for F1 through F12 - #2378

Open
ashokDevs wants to merge 1 commit into
herdrdev:masterfrom
ashokDevs:fix/1809-kitty-f1-f12
Open

fix: recognize kitty CSI-u codepoints for F1 through F12#2378
ashokDevs wants to merge 1 commit into
herdrdev:masterfrom
ashokDevs:fix/1809-kitty-f1-f12

Conversation

@ashokDevs

Copy link
Copy Markdown

Summary

kitty_codepoint_to_keycode mapped codepoints for F13-F35 (57376-57398) but had no entries for F1-F12 (57364-57375), so those silently fell through to None. Terminals that send function keys as full kitty CSI-u sequences (e.g. Ghostty, which enables the kitty keyboard protocol by default) had F1-F12 dropped entirely.

Reproduction

Confirmed live against a running herdr session: built the binary, started an isolated dev session with previous_tab/next_tab bound to F3/F4, and injected the raw byte sequences a kitty-protocol terminal sends for those keys (\x1b[57366u for F3, \x1b[57367u for F4) directly into the pane. Before the fix, both did nothing. After the fix, both correctly switched tabs.

I could not reproduce the exact asymmetry in #1809 (reporter says F2/F4 worked but F3 didn't) - in my testing the gap affects F1-F12 uniformly. This fix addresses the confirmed underlying gap either way.

Tests

  • just lint
  • just ci (3066 tests, 0 failures)
  • Added kitty_f1_through_f12_codepoints_are_recognized, replacing unknown_kitty_functional_key_remains_unsupported which had codified the gap as expected behavior

refs #1809

Codepoints 57364-57375 (F1-F12) were missing from the kitty-protocol codepoint table, so terminals that send function keys as full CSI-u sequences (e.g. Ghostty, which enables the kitty keyboard protocol by default) had those keys silently dropped. Confirmed live against a running herdr session: injecting the raw F3/F4 codepoint sequences did nothing before this fix and correctly triggered previous_tab/next_tab after.

refs herdrdev#1809
@coderabbitai

coderabbitai Bot commented Aug 5, 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: ae8fa1e0-6619-4f34-ab5f-68934001622d

📥 Commits

Reviewing files that changed from the base of the PR and between eb93ec8 and b5a7a34.

📒 Files selected for processing (1)
  • src/input/parse.rs

📝 Walkthrough

Walkthrough

The input parser now decodes Kitty functional key codepoints 57364..=57375 as F1–F12. Tests also verify recognition of F13, and the dedicated rejection path for Kitty functional codepoints was removed.

Changes

Kitty functional key parsing

Layer / File(s) Summary
Function key mapping and validation
src/input/parse.rs
The parser maps Kitty codepoints 57364..=57375 to F1–F12, removes the dedicated rejection branch, and tests F1–F13 recognition.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: recognizing Kitty CSI-u codepoints for F1 through F12.
Description check ✅ Passed The description explains the missing mappings, user impact, implementation, reproduction, tests, and issue reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

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 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants