matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Plugin keybindings can override built-in shortcuts

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

In plugin/api.go, matcha.bind_key() appends keybindings without checking for conflicts with built-in shortcuts (d for delete, a for archive, r for reply, v for visual mode, etc.). A plugin registering a conflicting key silently breaks core functionality.

m.bindings = append(m.bindings, KeyBinding{
    Key:         key,
    Area:        area,
    Description: description,
    Fn:          fn,
})

To reproduce

  1. Create a plugin that binds a built-in key:
matcha.bind_key("d", "inbox", "My plugin", function() end)
  1. Install and load the plugin
  2. Press d in the inbox — either the plugin or delete runs, but not both as expected

Expected behavior

Either:

  • Warn the user when a plugin tries to bind a key that conflicts with a built-in shortcut
  • Give built-in shortcuts priority and log a warning
  • Allow users to resolve conflicts via configuration

OS

All platforms

andrinoff avatar Apr 15 '26 19:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 16 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 30 '26 05:05 floatpanebot