Repository navigation
Let an empty key list in keymap.json unbind a command - #2950
Merged
Merged
Conversation
KeymapFile created a command's entry only while pushing its first keystroke, so `[]` left no entry and the template's keys stayed bound: there was no way to remove a shortcut, even by editing the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
manilabui
approved these changes
Oct 15, 2026
kvnloo
pushed a commit
to kvnloo/Mailspring
that referenced
this pull request
Oct 22, 2026
KeymapFile created a command's entry only while pushing its first keystroke, so `[]` left no entry and the template's keys stayed bound: there was no way to remove a shortcut, even by editing the file. Co-authored-by: Brian Hellman <brian.hellman@linbit.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit f2d305b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is no way to remove a keyboard shortcut. The Shortcuts preferences page can only replace one, and writing
"core:archive-item": []intokeymap.jsondoesn't work either:KeymapFile.loadcreated a command's entry only while pushing its first keystroke, so an empty list left no entry, and the template'sestayed bound.The entry is now created before the loop, so
[]is a command with no keys. The user keymap replaces lower layers per command (keymapCacheInvalidated), so that unbinds it. A template could also list[]to drop a base binding, the same way it already replaces one.This is the groundwork for removing shortcuts from the Shortcuts page (an × per key, Clear per section, Clear all), which needs a file format that can say "none". That comes as a follow-up.
Verified:
keymap-manager-specloads base + Gmail + a userkeymap.jsonfrom a temporary config folder.{"core:archive-item": []}leaves the command with no keys anderegistered to nothing (red with the old loop). A listed command's keys replace the template's. Live, in this branch's build on a copy of a live Gmail-template config (Electron 44.5.1, DevToolsInput.dispatchKeyEvent,queueTaskstubbed): with an empty user keymap,eon a focused thread queued its archive. With{"core:archive-item": []}, the bindings were[]andequeued nothing. On master the same file left["e"]. Lint, prettier and tsc clean; full suite 2441 passing on this branch (master4ebb582fb).Shortcuts page series (one concern each; merge in this order): #2950
[]unbinds, #2951 mail held behind Preferences, #2952 record with +, #2953 remove keys, #2955 conflict warnings, #2956 visual pass, #2957 search, #2958 single-key switch, #2959 Show filter.🤖 Generated with Claude Code