Skip to content

fix(terminal): pass composed Latin letters through as text under kitty - #20510

Closed
juscyllan wants to merge 4 commits into
stablyai:mainfrom
juscyllan:fix/20495-latin-compose-passthrough
Closed

juscyllan wants to merge 4 commits into
stablyai:mainfrom
juscyllan:fix/20495-latin-compose-passthrough

Conversation

@juscyllan

@juscyllan juscyllan commented Sep 13, 2026 •

Copy link
Copy Markdown

ELI5

Typing ç on a Brazilian keyboard died inside Orca's terminal whenever a TUI turned on kitty protocol. Now the character goes through.

What Changed

  • terminal-option-shortcut-policy.ts: one isLayoutComposedCharacter helper; compose-mode Option+letter yielding a Latin letter sends text instead of CSI-u.
  • New terminal-option-shortcut-policy.test.ts: 12 cases.

Why

ASCII compositions already pass through as text (#8031 split). Latin letters are the same case: no other way to type them, and TUI parsers drop Alt-combo CSI-u. µ/×/÷ and non-Latin glyphs keep hotkey encoding; Meta mode unchanged.

Linked Issue

Fixes #20495.

Visual Proof

N/A — keystroke routing, no visual change. Diagnosed live via fish_key_reader: bind alt-c in the broken tab vs bind ç in a working one, same window and setting.

Testing

  • I manually tested these changes locally (needs packaged build; verified at unit level plus live diagnosis above)
  • Automated tests added/updated: 47 pass across both policy test files (12 new)
  • oxlint clean, tsc --noEmit (web) exit 0; full CI will cover the rest
  • Platform: macOS (ABC layout). Untouched elsewhere — this path is isMac-gated.

AI Disclosure

Developed with OMP (muse-spark); directed, reviewed, and tested by the author.

Review

Agent skill upstream boundary

  • Not applicable — no skill/installer source, tests, fixtures, or docs touched.

Notes

macOS-only path; no Linux/Windows/SSH/mobile impact. Negligible perf impact (integer range compares per Option-keystroke under kitty).

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (macOS-only, N/A beyond)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (targeted files locally; CI will cover the rest)

@juscyllan
juscyllan force-pushed the fix/20495-latin-compose-passthrough branch from 82355e9 to c7faf07 Compare September 13, 2026 21:34
@coderabbitai

coderabbitai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d284a789-5350-4f12-899f-956613c91a87

📥 Commits

Reviewing files that changed from the base of the PR and between ef1d9b9 and b5b8010.

📒 Files selected for processing (1)
  • src/renderer/src/components/terminal-pane/terminal-shortcut-option-compose.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The terminal shortcut policy separates ASCII and Latin composition checks. It sends supported composed Latin letters as text during macOS Option compose mode. It excludes µ, ×, ÷, and ƒ. Tests cover Latin characters, CSI-u encoding, Option-as-Meta mode, plain keys, and inactive Kitty keyboard flags.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to b5b80

The change preserves hotkey behavior for excluded symbols and non-Latin glyphs while passing composed Latin text through as intended.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (6 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the change, reason, linked issue, testing, platform scope, visual proof, AI disclosure, and checklist. It is sufficiently complete.
Linked Issues check ✅ Passed The description includes a valid linked issue reference: Fixes #20495. The issue aligns with the stated macOS keyboard input objective.
Out of Scope Changes check ✅ Passed The changes are limited to terminal shortcut policy logic and related tests. They align with the stated objective and do not show unrelated scope.
Title check ✅ Passed The title clearly and concisely describes the main change: passing composed Latin letters through as text under kitty on macOS.
Linked Issues check ✅ Passed The pull request addresses #20495. When Kitty protocol is active, the shortcut policy sends composed Latin letters, including ç, as text on macOS. The tests cover ç and other composed Latin letter…
Out of Scope Changes check ✅ Passed The changes remain within the terminal input path for #20495. The implementation refines composed-character classification, and the tests verify the fix and existing behavior for other symbols and mod…
  • Fix all pre-merge checks with AI

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e6c25912-e613-4baa-9974-0aad1f927aff

📥 Commits

Reviewing files that changed from the base of the PR and between cf20e08 and 82355e9d6ecaf663c39e37e7a3c3e7b64eba6f0c.

📒 Files selected for processing (2)
  • src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.test.ts
  • src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Compose-mode Option+letter yielding ç/ã/å/ą was kitty-encoded to CSI-u,
which TUI parsers drop, making the character untypeable even with
'Option as Alt' off. ASCII compositions already passed through (the
stablyai#8031 split); extend the same rule to Latin-script letters. µ/×/÷ and
non-Latin glyphs keep their hotkey encoding; Meta mode unchanged.

Fixes stablyai#20495.
@juscyllan
juscyllan force-pushed the fix/20495-latin-compose-passthrough branch from c7faf07 to dc6586e Compare September 13, 2026 21:37
…wn base

Addresses review: explicit LATIN_COMPOSED_RANGES plus LATIN_HOTKEY_GLYPHS
(µ × ÷ ƒ) instead of broad property checks, and require a known changed
base character.
Drop the Record/array tables: plain integer compares, no per-keystroke
allocation. Keep the review refinements: ƒ joins the µ/×/÷ exclusion set
and a known changed base is required.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

This change silently flips å (U+00E5) and ƒ (U+0192) from kitty CSI-u hotkeys to raw text, but terminal-shortcut-option-compose.test.ts:139-154 still pins the old behavior — pnpm test fails on that file. The PR body says "targeted vitest files pass," but only the new test file was run.

Reviewed changes

  • isLayoutComposedLatinLetter in terminal-option-shortcut-policy.ts — passes composed Latin-script letters through as text under active kitty flags, mirroring the existing ASCII rule, with ×/÷ and µ excluded.
  • New terminal-option-shortcut-policy.test.ts — pins passthrough for ç ã å ą ñ ü, hotkey encoding for µ ÷ π, plus Meta, no-composition, and kitty-inactive cases.

ℹ️ Nitpicks

  • The codePoint === 0xb5 (µ) guard at terminal-option-shortcut-policy.ts:86 is unreachable: U+00B5 is below 0xc0 and outside every covered range. Drop it, or keep it only if the ranges ever widen.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The new 0x192 exclusion clears ƒ, but å (U+00E5) still falls through as text and terminal-shortcut-option-compose.test.ts:150 still expects it as \x1b[97;3u. pnpm test remains red (47/48) at ef1d9b9.

Reviewed changes

  • isLayoutComposedLatinLetter tightened — ƒ (U+0192) added to the exclusion list, and the base-character guard now returns false when characterWithoutOption is unknown (stricter than the ASCII sibling, which passes through).
  • New test unchanged — still asserts å passthrough and µ/÷/π hotkey encoding.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.ts (1)

51-96: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Require a known no-Option character for ASCII pass-through.

getLayoutCharacterForCode returns undefined for a shifted non-Key* code when no shifted layout character exists. resolveTerminalOptionShortcutAction then passes characterWithoutOption === undefined to isLayoutComposedAsciiCharacter. The predicate accepts the printable key as composed, and the no-all-keys Kitty branch sends raw text instead of CSI-u encoding the Option hotkey. Require a defined characterWithoutOption that differs case-insensitively before using the ASCII pass-through branch.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e37d8a58-3c81-42d4-b7be-c15a6a698805

📥 Commits

Reviewing files that changed from the base of the PR and between dc6586e and ef1d9b9.

📒 Files selected for processing (1)
  • src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

The non-ASCII hotkey test pinned å to CSI-u; å is everyday typing text
like ç, so it passes through now. ƒ/∫ stay encoded.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Delta since the prior Pullfrog review: the å (U+00E5) behavior flip is now reconciled with the existing #8031 hotkey test, and the full policy test set is green.

  • Reconciled the #8031 hotkey test — terminal-shortcut-option-compose.test.ts:150 now expects å/KeyA to pass through as data: 'å' instead of encoding \x1b[97;3u, and the test comment scopes #8031 to non-typing glyphs (ƒ, ∫) while Latin letters pass through per #20495. This matches the policy assertion already added in terminal-option-shortcut-policy.test.ts:28.

The earlier blocking concern (red pnpm test) is resolved: I ran all four terminal-pane policy test files — terminal-option-shortcut-policy.test.ts, terminal-shortcut-option-compose.test.ts, terminal-shortcut-policy.test.ts, terminal-option-kitty-release.test.ts — and they pass (92 tests). Both prior Pullfrog threads are now addressed and resolved.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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.

[Bug]: Typing in PT-BR (ç)

1 participant