Files
codewhale/crates
Hanmiao Li 5e22753ee1 fix(tui): normalize macOS SUPER (Cmd) to CONTROL for keyboard shortcuts (#2938) (#2943)
* fix(tui): normalize macOS SUPER (Cmd) to CONTROL for keyboard shortcuts (#2938)

On macOS, terminal emulators may report Cmd (SUPER) instead of Ctrl
(CONTROL) for keyboard shortcuts, depending on the terminal app and
its configuration. This caused Ctrl+B, Ctrl+Alt+2, and other shortcuts
to be inconsistent.

Fix:
- Add normalize_macos_modifiers() in composer_ui.rs
- On macOS: map SUPER to CONTROL when CONTROL is not already set
- On other platforms: no-op
- Apply normalization at the key event entry point in ui.rs

Tests:
- normalize_macos_modifiers_maps_super_to_control
- normalize_macos_modifiers_preserves_existing_control
- normalize_macos_modifiers_leaves_alt_unchanged

* fix: strip SUPER from modifiers after normalization per review

* fix: gate macOS-specific modifier tests with #[cfg(target_os = "macos")]
2026-06-12 10:53:09 -07:00
..