opencode icon indicating copy to clipboard operation
opencode copied to clipboard

bug(tui): Keyboard shortcuts don't work while Korean IME is active on macOS

Open hakun-sazo opened this issue 20 hours ago • 2 comments

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

  1. Set macOS input source to Korean (한글)
  2. Launch OpenCode TUI
  3. Try pressing any shortcut (e.g., Ctrl+L to clear, Ctrl+? for help)
  4. 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

hakun-sazo avatar Jan 15 '26 10:01 hakun-sazo