Fix Cmd+plus zoom on non-US keyboard layouts

Merged
LA
8mo ago
+124-14

Summary

  • fix zoom shortcut matching to consider both charactersIgnoringModifiers, literal event.characters, and the current keyboard-layout character for the pressed key code
  • route shifted literal zoom shortcuts (for example layouts where + comes from a non-= physical key) to both browser zoom and terminal font zoom paths
  • add regression tests for shifted-literal Cmd+Shift zoom-in routing and keep zoom shortcut matching gated behind command-modifier checks for hot-path performance

Testing

  • xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination 'platform=macOS' build (pass)
  • xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux-unit -configuration Debug -destination 'platform=macOS' -only-testing:cmuxTests/CmuxWebViewKeyEquivalentTests test (pass)

Issues

  • Related: task-jis-cmd-plus-zoom-in

Summary by CodeRabbit

New Features

  • Browser zoom shortcuts now work reliably across different keyboard layouts by recognizing both physical key positions and literal character inputs.
  • Enhanced zoom shortcut matching to consider keyboard layout variations and shifted key combinations.

Tests

  • Added test cases to verify browser zoom shortcuts function correctly with shifted modifiers and alternative physical keys.