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
@lyh970817

Copy link
Copy Markdown

A question about scope, not a review: this PR maps the kitty CSI-u codepoints (57364-57375) for F1-F12. Is it also intended to cover the case in #1809 where F3 arrives as \x1b[13;1:1~, the parameterized CSI tilde form rather than a CSI-u codepoint?

I have not built or tested this branch, so I am not claiming either way. I only note that my reproduction of #1809 (foot, herdr 0.8.0) produces the tilde form, and I could not tell from the description whether that path is in scope.

Happy to test a build against that reproduction if it is useful.

@WAY29

WAY29 commented Aug 19, 2026

Copy link
Copy Markdown

hey any review about this? need this fix

@ogulcancelik

Copy link
Copy Markdown
Collaborator

@ashokDevs this narrow CSI-u F1-F12 fix is still needed and is not superseded by #2578. the implementation review is clean. please rebase onto current master, add the user-facing entry to docs/next/CHANGELOG.md, and rerun checks and both review bots.

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.

5 participants