[PR #748] [MERGED] Support remapping keybindings #24296

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/748
Author: @zadjii-msft
Created: 5/13/2019
Status: Merged
Merged: 5/21/2019
Merged by: @zadjii-msft

Base: masterHead: dev/migrie/f/keybindings


📝 Commits (10+)

  • ed657a0 Add support for serializing keybindings
  • d3b9fa1 This is close, but at some point we lose the keybindings when they get reloaded
  • 82f4fff Fix actually loading the keys
  • 0e3a197 Don't serialize over the unordered_map
  • 66592b5 Clean up for PR
  • 23e7859 Merge remote-tracking branch 'origin/master' into dev/migrie/f/keybindings
  • 8727085 Some PR nits
  • 4b75c85 well that was easier than expected
  • 3eaabfa * use a constexpr wstring_view
  • 7aee31a Move the serialization of keychords into a seperate file.

📊 Changes

10 files changed (+641 additions, -156 deletions)

View changed files

📝 src/cascadia/TerminalApp/App.cpp (+1 -1)
📝 src/cascadia/TerminalApp/AppKeyBindings.cpp (+347 -152)
📝 src/cascadia/TerminalApp/AppKeyBindings.h (+3 -0)
📝 src/cascadia/TerminalApp/AppKeyBindings.idl (+3 -0)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+14 -2)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+8 -0)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+1 -0)
src/cascadia/TerminalApp/KeyChordSerialization.cpp (+249 -0)
src/cascadia/TerminalApp/KeyChordSerialization.h (+12 -0)
📝 src/cascadia/TerminalApp/TerminalApp.vcxproj (+3 -1)

📄 Description

Fixes #537.

Adds support for remappable keybindings in the profiles.json file. The keybindings look like the following:

    "keybindings": [
        {
            "keys": ["ctrl+t"],
            "command": "newTab"
        },
        {
            "keys": ["ctrl+shift+1"],
            "command": "newTabProfile0"
        },
        { "keys": ["ctrl+w"], "command": "closeTab" },
        { "keys": ["ctrl+tab"], "command": "nextTab" },
        { "keys": ["ctrl+shift+tab"], "command": "prevTab" },
        { "keys": ["ctrl+shift+pgup"], "command": "scrollUp" },
    ]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/748 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/13/2019 **Status:** ✅ Merged **Merged:** 5/21/2019 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `master` ← **Head:** `dev/migrie/f/keybindings` --- ### 📝 Commits (10+) - [`ed657a0`](https://github.com/microsoft/terminal/commit/ed657a0eafa89e26088408ca7cb2ecccf7849d88) Add support for serializing keybindings - [`d3b9fa1`](https://github.com/microsoft/terminal/commit/d3b9fa10d1a6371ebfe9991c15f996321a092989) This is close, but at some point we lose the keybindings when they get reloaded - [`82f4fff`](https://github.com/microsoft/terminal/commit/82f4fff1238788b50b20cbbfc2d570cd0e82c8cb) Fix actually loading the keys - [`0e3a197`](https://github.com/microsoft/terminal/commit/0e3a197bc30dd29c5daca51baaab727a3a1aa128) Don't serialize over the unordered_map - [`66592b5`](https://github.com/microsoft/terminal/commit/66592b5f19db5512cf5647aa36c7bd76f22f5068) Clean up for PR - [`23e7859`](https://github.com/microsoft/terminal/commit/23e7859abdcb5a80d664c48b11444b46430dfb93) Merge remote-tracking branch 'origin/master' into dev/migrie/f/keybindings - [`8727085`](https://github.com/microsoft/terminal/commit/872708512d109c237c764b25c752b8845833465f) Some PR nits - [`4b75c85`](https://github.com/microsoft/terminal/commit/4b75c853379298fe74a952fcf0d1ee9a2b7fb8a9) well that was easier than expected - [`3eaabfa`](https://github.com/microsoft/terminal/commit/3eaabfac86f54ef2be4cb6279a97590b0b3b38af) * use a constexpr wstring_view - [`7aee31a`](https://github.com/microsoft/terminal/commit/7aee31a44f42683c6f4a4b67207f1d9e298e86e5) Move the serialization of keychords into a seperate file. ### 📊 Changes **10 files changed** (+641 additions, -156 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/App.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/AppKeyBindings.cpp` (+347 -152) 📝 `src/cascadia/TerminalApp/AppKeyBindings.h` (+3 -0) 📝 `src/cascadia/TerminalApp/AppKeyBindings.idl` (+3 -0) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+14 -2) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+8 -0) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+1 -0) ➕ `src/cascadia/TerminalApp/KeyChordSerialization.cpp` (+249 -0) ➕ `src/cascadia/TerminalApp/KeyChordSerialization.h` (+12 -0) 📝 `src/cascadia/TerminalApp/TerminalApp.vcxproj` (+3 -1) </details> ### 📄 Description Fixes #537. Adds support for remappable keybindings in the profiles.json file. The keybindings look like the following: ```json "keybindings": [ { "keys": ["ctrl+t"], "command": "newTab" }, { "keys": ["ctrl+shift+1"], "command": "newTabProfile0" }, { "keys": ["ctrl+w"], "command": "closeTab" }, { "keys": ["ctrl+tab"], "command": "nextTab" }, { "keys": ["ctrl+shift+tab"], "command": "prevTab" }, { "keys": ["ctrl+shift+pgup"], "command": "scrollUp" }, ] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:02:28 +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#24296