Skip to content

fix: adapt keyboard shortcut display for macOS#2484

Open
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67:fix/mac-keyboard-shortcut-display
Open

fix: adapt keyboard shortcut display for macOS#2484
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67:fix/mac-keyboard-shortcut-display

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 19, 2026

TLDR

On macOS, keyboard shortcut hints now use native modifier symbols ( for Ctrl, for Cmd, for Alt, for Shift) instead of the generic text format.

Closes #2227

Dive Deeper

The CLI keyboard shortcut panel and error retry hints displayed shortcuts like ctrl+y, cmd+v regardless of platform. On macOS, the convention is to use symbolic modifiers (⌃Y, ⌘V).

Changes:

  • packages/cli/src/ui/utils/shortcutFormatter.ts — New formatShortcut() utility that converts modifier names to macOS symbols when process.platform === "darwin"
  • packages/cli/src/ui/components/KeyboardShortcuts.tsx — Apply formatShortcut() to shortcut key display
  • packages/cli/src/ui/hooks/useGeminiStream.ts — Apply formatShortcut() to "Press Ctrl+Y to retry" hint messages
  • packages/cli/src/ui/utils/shortcutFormatter.test.ts — Tests for Mac symbol conversion, multi-part shortcuts, and non-Mac passthrough

Non-macOS platforms are completely unaffected — the formatter is a no-op on Linux/Windows.

Reviewer Test Plan

  1. Run on macOS — verify shortcut panel shows ⌃Y, ⌃C, ⌘V etc.
  2. Trigger an API error — verify retry hint shows ⌃Y instead of Ctrl+Y
  3. Run on Linux/Windows — verify shortcuts display unchanged (ctrl+y, ctrl+c)

Testing Matrix

🍏 🪟 🐧
npm run

Linked issues / bugs

Closes #2227

Closes QwenLM#2227

On macOS, keyboard shortcut hints now use native modifier symbols
(⌃ for Ctrl, ⌘ for Cmd, ⌥ for Alt, ⇧ for Shift) instead of
the generic "ctrl+", "cmd+" text format.

- Add formatShortcut() utility in shortcutFormatter.ts
- Apply to KeyboardShortcuts panel and retry hint messages
- Non-macOS platforms are unaffected
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