Skip to content

fix(web): type macOS Option characters in the terminal - #23

Closed
macodev00 wants to merge 1 commit into
mainfrom
cursor/fix-german-terminal-at-4b25
Closed

macodev00 wants to merge 1 commit into
mainfrom
cursor/fix-german-terminal-at-4b25

Conversation

@macodev00

@macodev00 macodev00 commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

What Changed

On macOS, a lone Option that produces a character is marked consumed (Shift too, when it participated) before libghostty-vt encodes the key. Ctrl, Meta, and Option+arrow are unchanged.

Why

Fixes pingdotgg#13046. On a German Mac layout @ is Option+L. The desktop terminal (and the web app, which shares this Ghostty surface) always forwarded Option as Alt. The vendored encoder is not a macOS build, so Ghostty's macos-option-as-alt = false path never runs, and DEC 1036 (alt_esc_prefix) turns Option+L into ESC @. At a bash/zsh prompt that is set-mark, so nothing appears. The same encoding drops the rest of that Option layer (€, ~, []{}|, \).

Consuming Option makes the encoder write the composed character, which is Terminal.app with "Use Option as Meta key" off and Ghostty's default. Option+letter meta chords such as Option+B, which today become ESC b via the unshifted-codepoint fallback, will type the composed character instead.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI chrome change, so no before/after screenshots
  • No animation or interaction timing change, so no video
Open in Web Open in Cursor 

German Option+L produces @, but the terminal forwarded Option as Alt into
the non-macOS libghostty-vt build. DEC 1036 then sent ESC @, which readline
treats as set-mark, so the character never appeared. The same path dropped
the rest of the Option layer.

Consume a lone Option on macOS, and Shift when it helped produce the
character, so the encoder writes the composed character. Ctrl, Meta, and
Option+arrow stay chords.

Fixes pingdotgg#13046
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 23, 2026
@macodev00

Copy link
Copy Markdown
Owner Author

Superseded by upstream READY PR on pingdotgg/t3code (same branch).

@macodev00 macodev00 closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot type @ char in Terminal on MacOS with German Keyboard Layout

1 participant