Repository navigation
fix(terminal): preserve Polish and Option-composed text in kitty panes - #21082
Conversation
Adapt the composition fix from #20579 and the input-source correction from #20164. Extend coverage to every Polish letter, live setting changes, associated text, and Chromium-to-PTY word entry. Co-authored-by: yu.xia <[email protected]> Co-authored-by: Alexandre Blause <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change sends non-ASCII Option-composed characters as literal input when Option is configured as compose. It preserves kitty CSI-u encoding when Option acts as Alt. The character check now handles Unicode code points and surrogate pairs. US International PC is classified as compose instead of meta. Unit and end-to-end tests cover Polish characters, supplementary-plane characters, kitty flags, Alt configuration, and CDP input. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change preserves composed text for compose-side Option input while retaining explicit Alt shortcuts, with no actionable merge risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor config-consistency suggestion.
Reviewed changes
- Widened kitty compose policy —
isLayoutComposedCharacterdrops thecodePoint <= 0x7eASCII ceiling, so any single printable non-ASCII composition (Polish letters,π,ƒ,∫,¡,≥, supplementary-plane symbols) is sent as raw text on a compose side; C1 controls stay excluded andArray.fromcounts code points once. - US-International-PC now composes —
classifyInputSourceIdnarrows themetaallowlist to plaincom.apple.keylayout.US, so US-International-PC resolves tocomposeunder Auto. - Tests — unit coverage for all nine Polish letters and uppercase forms under flags 1/5 across compose and Alt sides, supplementary-plane compositions, report-all associated text, and three new live-PTY e2e scenarios; the fingerprint/probe comments were refreshed to match.
- Verification done in this run — the three changed unit files pass (84 tests), and restoring the old ASCII ceiling makes the new non-ASCII expectations fail, so they are discriminating rather than tautological.
ℹ️ reliability-gates.jsonc still describes the pre-widening test contract
The manifest entries for tests/e2e/terminal-option-composed-ascii.spec.ts and terminal-shortcut-option-compose.test.ts were not updated. The e2e gate still promises "a non-ASCII Option glyph still reaches the application as its alt hotkey", which is now true only when Option is explicitly configured as Alt — the spec sets setMacOptionAsAlt(orcaPage, 'true') for exactly that case — and its 2026-08-16 evidence run still reports "Four live-Electron scenarios passed" while the spec now has seven tests (including the Polish, report-all, and rendered-word scenarios). The manifest's checker validates structure, not assertion text, so this is not a CI failure; it is drift in a reviewed artifact that future gate edits tend to copy forward.
Technical details
# stale reliability-gate text after the compose-policy widening
## Affected sites
- `config/reliability-gates.jsonc:13367-13370` — the `tests/e2e/terminal-option-composed-ascii.spec.ts` `assertionRefs` list: "receives the Option-composed ASCII character" is now broader, and "a non-ASCII Option glyph still reaches the application as its alt hotkey" is now conditional on an explicit Alt setting.
- `config/reliability-gates.jsonc:13553` — the `2026-08-16` `evidenceRuns` summary still says "Four live-Electron scenarios passed" and frames the non-ASCII case as unconditional.
## Required outcome
- The gate text and any refreshed evidence summary describe the widened compose policy and the new tests, and state that non-ASCII Alt+glyph hotkeys now require an explicitly configured Alt side.
## Suggested approach (optional)
- Re-run `pnpm run test:e2e -- tests/e2e/terminal-option-composed-ascii.spec.ts` and add/refresh an `evidenceRuns` entry with the current scenario count; adjust the four `assertionRefs` strings to match the spec's current titles and behavior.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Settings visual proof for #21082 at These are existing controls, not new UI introduced by this PR. Settings → search “Option as Alt” exposes Auto / Both / Left / Right / Off. Auto displays the detected role; Left explains the split. Captured the hidden renderer through CDP from this branch in an isolated profile with CJK check: Pinyin and Korean 2-Set already classify as composition under Auto before this PR. The new Option text predicate preserves the IME-owned-event exclusions. 659 focused tests across 46 files passed, including IME, Option, kitty tracking and preview coverage. These screenshots prove settings behavior, not native Chinese/Korean typing or receiving-agent behavior under report-all. Those remain unverified. |
|
Additional pre-merge verification at
|
Native M4 Air regression gateI ran the repository’s native macOS 2-Set Korean terminal suite on the connected M4 Air, with Accessibility enabled and the system input source switched to
PR-head failures:
The first test ( The earlier 26 rendered tests and 659 focused unit tests remain green; they do not cover this native event shape. The likely regression surface is the widened non-ASCII composition predicate in |
516f430 to
23fdb41
Compare
There was a problem hiding this comment.
Important
The new Hangul jamo clause is only reached when Option is held, so it cannot address the native 2-Set Korean regression the author flagged as blocking. Please re-run the native gate on this head and report the result.
Reviewed changes
- Hangul jamo classified as IME-owned —
isImeOwnedKeynow returnstruefor a single jamo, soresolveTerminalOptionShortcutActionreturnsnulland the press is left to the text-input/IME path. - Unit coverage —
{ key: 'ㅏ', code: 'KeyK' }joins the IME-owned table; ablating the clause makes the case fail, so it is discriminating.
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
src/renderer/src/components/terminal-pane/terminal-option-shortcut-policy.ts:79(RIGHT) — line 79 (RIGHT) is not inside a diff hunk
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Follow-up native validation on the immediate parent and PR head, using the isolated M4 Air with the required foreground launch:
The failed trace had |
|
@nwparker thanks for this PR. How long until it's released? Thanks :) |
|
+1 |
…2608) #21082 widened the kitty composed-text check from ASCII to every printable codepoint, which is what restored French Option+$ -> €. Nothing pinned a composed character on a punctuation code: the Polish cases all sit on `Key*` codes, whose unmodified character the US fallback table also answers, so they pass even when the layout map is the only source of `characterWithoutOption`. Reverting the widening fails this case at kitty flags 1, 3, 5 and 7. Co-authored-by: rasata <[email protected]>
|
@angelod1as @lucasbastianik it's out. First release carrying it is v1.4.209 (23 Sep). Note that v1.4.206 and v1.4.207 were published after the merge but do not contain it. |



ELI5
With Option configured to compose characters, starting a kitty-protocol TUI could turn Polish letters into Alt shortcuts. Option+A now types
ąunder the same setting at the shell and under Claude Code's flags. US-International-PC also defaults to composition.What Changed
Credit: #20579 by @eatmoreduck (yu.xia) and #20164 by Alexandre Blause; both original commit identities are included as
Co-authored-bytrailers. #20510 was reviewed as an alternative, not copied.Why
The composition setting must apply to non-ASCII letters too. Restricting text to ASCII made ordinary Polish prose impossible after a TUI negotiated kitty keyboard handling.
Linked Issue
Fixes #20171
Fixes #20850
Fixes #20163
Related: #20495; adaptations of #20579 and #20164; alternative policy in #20510.
User trade-offs
There are two intentional behavior changes; this is not a zero-trade-off claim:
π,ƒ, or∫now type those characters instead of firing the previous kitty Alt shortcut. Configure Left or Right Option as Alt to retain shortcuts on one side and composition on the other; Both retains shortcuts on both sides at the cost of composed typing there.Uncomposed keys and configured Alt sides still send chords. Report-all/associated-text behavior is unchanged.
Migration / release note
On macOS, Option keys configured for character composition now keep typing those characters inside affected terminal agents, including non-ASCII letters. If an Option shortcut now types a character, open Settings → Terminal → Advanced → Option as Alt (or search Option as Alt). Choose Both for Alt shortcuts on both keys, or Left/Right to keep one key for shortcuts and the other for typing. Off keeps both keys available for composition. These controls already exist; no explicit preference is rewritten.
US-International-PC on Auto now defaults to composition. Chinese Pinyin and Korean 2-Set on Auto already used composition; their default does not change. Standard-US Auto remains Alt. The Option-shortcut tradeoff can still apply to Chinese/Korean users when their input source emits a qualifying composed Option character.
Visual Proof
Same
zażółć wcześniej łącznieChromium key events, Option Off, and flags 5. These are hidden-renderer CDP checks, not physical keyboard tests. Before uses the original policy ate6a41081a3c; after uses this change. The test asserts exact outgoing PTY bytes and rendered terminal output.Before: composed letters become escape sequences.
After: all words render correctly.
Testing
ORCA_BACKGROUND_LAUNCH=1.macOS validation:
terminal-option-composed-ascii.spec.ts: all 7 tests passed. Original-policy word test fails with the expected Alt sequences; the fixed build passes.pnpm tc:web,pnpm run check:code-quality:changed, formatting, andgit diff --checkpassed. Changed-code gate: zero new findings across 8 files.Review
Upstream review evidence (not approvals of this branch)
All reviewed upstream submissions have
COMMENTEDreviews, notAPPROVEDreviews.2feff9fdacross protocol off/1/5/29, including explicit Alt and Option+Enter. This supports the adapted policy but is not physical testing of this combined branch. Additional upstream custom-layout verification is likewise upstream-only evidence.Readiness checklist
Scoped verdict: PASS for the changed code; no candidate P0/P1/P2 defects. Severity counsel was skipped under the checklist's zero-candidate exception. This does not claim release-wide or all-platform certification.
Residual verification: physical Polish typing on this branch (M4 Air is available), real Claude/Codex/OpenCode sessions beyond protocol fixtures, and live network fault testing remain unperformed. No evidence of a regression in those scenarios was found.
Agent skill upstream boundary
Checklist