Json Fragment Actions do not load keys binding #21686

Closed
opened 2026-01-31 07:51:58 +00:00 by claunia · 2 comments
Owner

Originally created by @g0t4 on GitHub (May 10, 2024).

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

Originally created by @g0t4 on GitHub (May 10, 2024). ### 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.: ```json { "actions": [ { "command": { "action": "splitPane", "type": "scratchpad" }, "name": "Split Scratchpad Pane", "keys": "ctrl+shift+5" } ] } ``` 2. Restart terminal 3. 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. 4. 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: <img width="1142" alt="image" src="https://github.com/microsoft/terminal/assets/180189/561e1252-84cb-4462-9344-b9a1bbd7a9fb"> when loaded from primary settings.json: <img width="1138" alt="image" src="https://github.com/microsoft/terminal/assets/180189/7b34612e-7582-468e-b9e0-4290dae9fb02">
claunia added the Resolution-By-DesignNeeds-TriageIssue-Bug labels 2026-01-31 07:51:59 +00:00
Author
Owner

@DHowett commented on GitHub (May 10, 2024):

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!

@DHowett commented on GitHub (May 10, 2024): 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!
Author
Owner

@g0t4 commented on GitHub (May 10, 2024):

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:
@.***>

@g0t4 commented on GitHub (May 10, 2024): 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: > ***@***.***> >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21686