Skip to content

fix ghostty keyboard layout keyup leak#190

Merged
khoi merged 1 commit into
mainfrom
bugfix/keyboard-layout-keyup-only
Mar 29, 2026
Merged

fix ghostty keyboard layout keyup leak#190
khoi merged 1 commit into
mainfrom
bugfix/keyboard-layout-keyup-only

Conversation

@khoi
Copy link
Copy Markdown
Contributor

@khoi khoi commented Mar 29, 2026

summary

  • suppress only the stale keyUp that follows a keyboard layout switch
  • leave flagsChanged on the normal path
  • add regression coverage for matching, expiry, and negative cases

why

the leaked sequence is the trigger key release, so swallowing modifier
changes is broader than needed and risks breaking other bindings.

this pr supersedes #179.

validation

  • xcrun swift-format -p --in-place --recursive --configuration ./.swift-format.json supacode supacodeTests
  • mise exec -- swiftlint --fix --quiet
  • mise exec -- swiftlint lint --quiet --config .swiftlint.yml
  • 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
  • make build-app

Summary:
- suppress only the stale keyUp that follows a keyboard layout switch
- leave modifier flagsChanged events on the normal path
- add regression tests for matching, expiry, and negative cases

Rationale:
- the leaked sequence is the trigger key release, so suppressing
  modifier changes is broader than needed
- keeping flagsChanged untouched avoids reintroducing modifier
  binding regressions while still fixing the raw key leak

Validation:
- xcrun swift-format -p --in-place --recursive --configuration
  ./.swift-format.json supacode supacodeTests
- mise exec -- swiftlint --fix --quiet
- mise exec -- swiftlint lint --quiet --config .swiftlint.yml
- 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
- make build-app
@khoi khoi enabled auto-merge March 29, 2026 20:21
@khoi khoi merged commit ff39aa6 into main Mar 29, 2026
1 check passed
@khoi khoi deleted the bugfix/keyboard-layout-keyup-only branch March 29, 2026 20:27
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.

1 participant