Skip to content

fix(opensidian): use Backquote key code for terminal shortcut#1860

Open
Gautam-aman wants to merge 2 commits into
EpicenterHQ:mainfrom
Gautam-aman:feat/fix-terminal-shortcut-macos
Open

fix(opensidian): use Backquote key code for terminal shortcut#1860
Gautam-aman wants to merge 2 commits into
EpicenterHQ:mainfrom
Gautam-aman:feat/fix-terminal-shortcut-macos

Conversation

@Gautam-aman

@Gautam-aman Gautam-aman commented May 29, 2026

Copy link
Copy Markdown

Summary

Fixes terminal toggle shortcut detection on macOS.

The terminal shortcut handler currently checks KeyboardEvent.key === '\'when handlingCmd + /`Ctrl + . On some macOS keyboard layouts and configurations, the key value may differ even though the physical backquote key is pressed.

This change switches the shortcut detection to use KeyboardEvent.code === 'Backquote', which is layout-independent and consistently identifies the physical backquote key.

Changes

  • Replaced e.key === '\'withe.code === 'Backquote'` in the terminal shortcut handler.
  • Preserved existing support for both metaKey (macOS Command key) and ctrlKey.

Why

The UI and onboarding text indicate that ⌘ + \`` should toggle the terminal, but users have reported that only Ctrl + ``works. UsingKeyboardEvent.code provides more reliable shortcut detection across macOS keyboard layouts.

Fixes #1718


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@Gautam-aman

Copy link
Copy Markdown
Author

I've opened a PR for this issue. The fix updates terminal shortcut detection to use KeyboardEvent.code ("Backquote") instead of KeyboardEvent.key, which should improve reliability for Cmd + ` on macOS. Please let me know if you'd like me to adjust the approach.

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.

Opensidian: Keyboard shortcut hint displays Cmd + (backtick) but only Ctrl + functions

1 participant