Skip to content

test(terminal): pin Option-composed currency on a punctuation key - #22608

Merged
nwparker merged 1 commit into
mainfrom
nwparker/sta-8269-option-composed-currency
Sep 24, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/sta-8269-option-composed-currency

Conversation

@nwparker

@nwparker nwparker commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26
Prod 0 0 0 0

ELI5

On a French Apple keyboard, ⌥+$ types €. In an Orca terminal it typed nothing. That was fixed in v1.4.209 — this adds the test that keeps it fixed, because the tests we had would all still have passed while € was broken.

What Changed

One test case. terminal-shortcut-option-compose.test.ts gains French ⌥+$ → € across kitty flags 1, 3, 5 and 7 and all three Option-as-Alt compose modes.

No product code changes.

Why

isLayoutComposedCharacter used to accept only 0x21–0x7e, so every Option-composed character outside ASCII — € at U+20AC, and every accented letter — was re-encoded as an Alt chord and the character never reached the TUI. #21082 widened it to every printable codepoint and landed in v1.4.209, which is what makes #22447 pass today.

What #21082 pinned was the Polish letters. Those all sit on Key* codes, and pc101CharacterForCode answers Key* from the US fallback table, so characterWithoutOption resolves even when the layout map does not. € sits on a punctuation code where the layout map is the only source. Reverting the widening fails this new case at every flag value and leaves the Polish cases green — which is the gap.

Verified by reverting isLayoutComposedCharacter to the old ASCII bound: 8 failures, all of them the new case.

Linked Issue

Fixes #22447

Visual Proof

N/A — test-only change; no product behavior moves.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
pnpm vitest run src/renderer/src/components/terminal-pane/terminal-shortcut-option-compose.test.ts
  Tests  44 passed (44)

# with isLayoutComposedCharacter reverted to codePoint <= 0x7e:
  Tests  8 failed — all four flag values of the new case

I also confirmed end to end, on a real PTY under the macOS renderer policy, that ⌥+$ delivers € as a single write at kitty flags 0 (Claude Code negotiates none) and 7 (Codex negotiates CSI > 7 u). The reporter filed against a build predating v1.4.209; asking them to confirm on current before closing.

AI Disclosure

Claude Opus 5 was used to reproduce the reported case against the current build, locate which commit already fixed it, and find the coverage gap.

Review

Whether pinning one punctuation-code case is the right size, or whether the layout-map path deserves a table across several non-US layouts.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only. No security, platform, SSH, mobile, performance or compatibility surface.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (N/A)
  • Targeted tests run locally; CI covers the rest

#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]>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: d9ede2e1-0b99-4807-b360-070368a0ef9e

📥 Commits

Reviewing files that changed from the base of the PR and between ca75bc4 and 19e9e12.

📒 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

Adds a parameterized test for French Mac Option+$ composition. The test checks that resolving Option+BracketRight sends € across kitty flags 1, 3, 5, and 7, with Option-as-Alt disabled or configured on either side.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 19e9e

The new test protects euro composition across the listed kitty flags and Option settings. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the focused change: adding a regression test for Option-composed currency input on a punctuation key.
Description check ✅ Passed The description is complete and relevant. It covers the user impact, exact test coverage, rationale, linked issue, visual-proof exception, test results, AI disclosure, scope considerations, and checkl…
Linked Issues check ✅ Passed Issue #22447 requires Option+$ on a French Mac layout to produce € in terminal input. The PR adds an automated regression test in terminal-shortcut-option-compose.test.ts. The test resolves `Bracket…
Out of Scope Changes check ✅ Passed The whole PR changes only src/renderer/src/components/terminal-pane/terminal-shortcut-option-compose.test.ts. The change directly tests issue #22447 and adds no unrelated product, configuration, or …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

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.

@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 critical issues — one inaccurate comment worth correcting.

Reviewed changes

  • New currency composition case — adds Option+$ → € on a French Mac layout (key: '€', code: 'BracketRight') across kitty flags 1/3/5/7 and the three compose modes in terminal-shortcut-option-compose.test.ts:154. Test-only; no production code changes.

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

Comment on lines +154 to +156
// #22447: Option+$ composes € on a French Mac layout. The Polish cases above all
// sit on `Key*` codes whose unmodified character the US fallback table also knows;
// a punctuation code resolves `characterWithoutOption` through the layout map alone.

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.

Two claims here do not hold, and they are the stated reason this test exists. pc101CharacterForCode('BracketRight') returns ']' from the US fallback table, so characterWithoutOption resolves even when layoutCharacterForCode is not supplied — the layout map is not the only source — and the Polish cases sit below this test, not above.

Reverting the widening to codePoint > 0x20 && codePoint <= 0x7e fails #20171, both Polish cases, and the supplementary-plane case as well (8 failures, only 4 of them this new test), so it does not close a gap the existing cases left open. The test is still worth keeping for the punctuation-code variant and flags 3/7; just correct the rationale.

Suggested change
// #22447: Option+$ composes € on a French Mac layout. The Polish cases above all
// sit on `Key*` codes whose unmodified character the US fallback table also knows;
// a punctuation code resolves `characterWithoutOption` through the layout map alone.
// #22447: Option+$ composes € on a French Mac layout. Unlike the `Key*` cases
// above, this covers a non-ASCII character composed over a punctuation code,
// across kitty flags 1, 3, 5, and 7.

@nwparker
nwparker merged commit 5ba9649 into main Sep 24, 2026
31 checks passed
@nwparker
nwparker deleted the nwparker/sta-8269-option-composed-currency branch September 24, 2026 05:43
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]: Apple's keyboard is not fully compatible, we can not handle [Option] + [ € ], it does not produce char in the terminal

1 participant