Skip to content

fix cyrillic layout switch key leak#179

Closed
yaroslavyaroslav wants to merge 1 commit into
supabitapp:mainfrom
yaroslavyaroslav:bugfix/bad-chars-on-cyrillic
Closed

fix cyrillic layout switch key leak#179
yaroslavyaroslav wants to merge 1 commit into
supabitapp:mainfrom
yaroslavyaroslav:bugfix/bad-chars-on-cyrillic

Conversation

@yaroslavyaroslav
Copy link
Copy Markdown
Contributor

@yaroslavyaroslav yaroslavyaroslav commented Mar 27, 2026

Summary

Fixes a keyboard input bug where switching to a Cyrillic/Russian layout could leak raw keyboard protocol fragments like [32;1:3u into the Codex terminal input.

The root cause was that keyDown was already suppressed when the macOS input source changed, but the matching keyUp and modifier release events were still being forwarded to Ghostty. This change adds a narrow suppression window for those follow-up events and covers it with tests.

Verification

  • xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" -only-testing:supacodeTests/ GhosttySurfaceViewTests CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -quiet
  • make build-app
  • make test
  • make format

@khoi
Copy link
Copy Markdown
Contributor

khoi commented Mar 29, 2026

i think the fix should stay smaller here. [32;1:3u looks like the space keyup, so i would only suppress the matching keyup after the layout switch and leave flagsChanged alone. swallowing modifier changes feels risky and it dont match upstream ghostty, which already moved away from that because it broke bindings.

@khoi
Copy link
Copy Markdown
Contributor

khoi commented Mar 29, 2026

superceded by the new PR

@khoi khoi closed this Mar 29, 2026
@yaroslavyaroslav yaroslavyaroslav deleted the bugfix/bad-chars-on-cyrillic branch March 30, 2026 08:40
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.

2 participants