microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
93.92k stars 8.12k forks source link

Json Fragment Actions do not load `keys` binding #17240

Closed g0t4 closed 3 weeks ago

g0t4 commented 3 weeks ago

Windows Terminal version

1.22.1281.0

Windows build number

10.0.22635.3570

Other Software

No response

Steps to reproduce

  1. Add a json fragment file with a new action + key binding, i.e.:
{
  "actions": [
    { "command": { "action": "splitPane", "type": "scratchpad" }, "name": "Split Scratchpad Pane", "keys": "ctrl+shift+5" }
  ]
}
  1. Restart terminal
  2. Open command palette and search for scratchpad and thew new entry shows up but the key binding is missing (on right side). Also, using the key binding doesn't work.
  3. Move action into primary settings.json file and restart terminal, and now the key binding loads and shows in the command palette.

Expected Behavior

The keybinding should load regardless where the action is defined.

Actual Behavior

when loaded from a fragment:

image

when loaded from primary settings.json:

image
DHowett commented 3 weeks ago

Fragments are not allowed to bind keys. This is to prevent packages from overriding your key bindings in a way you cannot control or discover. We'll update the docs to make this much clearer, thanks!

g0t4 commented 3 weeks ago

Is there any possibility that they could be allowed to? Or perhaps allow them to set a default keybinding?

I want to use Fragments to break up my settings.json file into more manageable pieces... if I have to do keybindings in the settings.json then that is two spots to edit and defeats the purpose

On Fri, May 10, 2024 at 2:27 PM Dustin L. Howett @.***> wrote:

Fragments are not allowed to bind keys. This is to prevent packages from overriding your key bindings in a way you cannot control or discover. We'll update the docs to make this much clearer, thanks!

— Reply to this email directly, view it on GitHub https://github.com/microsoft/terminal/issues/17240#issuecomment-2105155470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL7XPF6DOSR66NDJOLA7DZBUNQNAVCNFSM6AAAAABHRDUDTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGE2TKNBXGA . You are receiving this because you authored the thread.Message ID: @.***>