bug(tui): Keyboard shortcuts don't work while Korean IME is active on macOS
Bug Description
Keyboard shortcuts (e.g., Ctrl+L, Ctrl+C, Ctrl+?) do not trigger while the Korean IME (Input Method Editor) is active on macOS. The shortcuts only work when the input source is switched to English (U.S.).
This is similar to #7556 (Russian input source issue with Ctrl+V), but affects all keyboard shortcuts, not just paste.
Steps to Reproduce
- Set macOS input source to Korean (한글)
- Launch OpenCode TUI
- Try pressing any shortcut (e.g.,
Ctrl+Lto clear,Ctrl+?for help) - Observe that nothing happens
Expected Behavior
Keyboard shortcuts should work regardless of the active input method/input source.
Actual Behavior
Shortcuts are completely ignored when Korean IME is active. User must switch to English input source to use any shortcuts.
Environment
- OS: macOS (Apple Silicon)
- OpenCode Version: 1.1.20
- Terminal: Kitty
- Input Method: macOS Korean IME (2-Set Korean)
Impact
Korean users must constantly switch between input sources just to use shortcuts, severely degrading the user experience. This makes keyboard-centric workflows nearly impossible for CJK users.
Technical Context
This is a common issue with terminal TUI applications that don't properly handle IME composition state. The key events may be getting consumed by the IME layer before reaching the application's key handler.
Possible solutions:
- Check for modifier keys (Ctrl, Alt, Cmd) and bypass IME processing
- Handle key events at a lower level before IME intercepts them
- Use platform-specific APIs to detect shortcut combinations during IME composition
Related Issues
- #7556 - Ctrl+V image paste fails with Russian input source on macOS
- #3493 - Korean (Hangul) characters display as broken/garbled in input field