[PR #7537] Introduce KeyMapping and Move TerminalSettings construction #26942

Open
opened 2026-01-31 09:19:02 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7537

State: closed
Merged: Yes


KeyMapping was introduced to break up AppKeyBindings. KeyMapping
records the keybindings from the JSON and lets you query them.
AppKeyBindings now just holds a ShortcutActionDispatcher to run
actions, and a KeyMapping to record/query your existing keybindings.
This refactor allows KeyMapping to be moved to the
TerminalSettingsModel, and ShortcutActionDispatcher and
AppKeyBindings will stay in TerminalApp.

AppKeyBindings had to be passed down to a terminal via
TerminalSettings. Since each settings object had its own
responsibility to update/create a TerminalSettings object, I moved all
of that logic to TerminalSettings. This helps with the
TerminalSettingsModel refactor, and makes the construction of
TerminalSettings a bit cleaner and more centralized.

References

#885 - this is all in preparation for the TerminalSettingsModel

Validation Steps Performed

  • Tests passed
  • Deployment succeeded
**Original Pull Request:** https://github.com/microsoft/terminal/pull/7537 **State:** closed **Merged:** Yes --- `KeyMapping` was introduced to break up `AppKeyBindings`. `KeyMapping` records the keybindings from the JSON and lets you query them. `AppKeyBindings` now just holds a `ShortcutActionDispatcher` to run actions, and a `KeyMapping` to record/query your existing keybindings. This refactor allows `KeyMapping` to be moved to the TerminalSettingsModel, and `ShortcutActionDispatcher` and `AppKeyBindings` will stay in TerminalApp. `AppKeyBindings` had to be passed down to a terminal via `TerminalSettings`. Since each settings object had its own responsibility to update/create a `TerminalSettings` object, I moved all of that logic to `TerminalSettings`. This helps with the TerminalSettingsModel refactor, and makes the construction of `TerminalSettings` a bit cleaner and more centralized. ## References #885 - this is all in preparation for the TerminalSettingsModel ## Validation Steps Performed - [x] Tests passed - [X] Deployment succeeded
claunia added the pull-request label 2026-01-31 09:19:02 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26942