Resolve terminal keybindings on server before sending config

- Move default keybinding resolution/override merging into `server.getConfig`
- Return server-resolved keybindings to the web client instead of resolving in UI
- Update docs and tests to reflect server-side defaults, overrides, and truncation behavior
This commit is contained in:
Julius Marminge authored and Julius Marminge committed 2026-02-15 15:51:05 -08:00
1 parent 31aa32b83b
commit f1cd76c17a
6 files changed
+108 -134

No files matched your search

+20 -4
View File
@@ -309,7 +309,11 @@ describe("WebSocket Server", () => {
expect(response.error).toBeUndefined();
expect(response.result).toEqual({
cwd: "/my/workspace",
keybindings: [],
keybindings: [
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
],
});
});
@@ -379,7 +383,11 @@ describe("WebSocket Server", () => {
expect(response.error).toBeUndefined();
expect(response.result).toEqual({
cwd: "/my/workspace",
keybindings: [{ key: "mod+j", command: "terminal.toggle" }],
keybindings: [
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
{ key: "mod+j", command: "terminal.toggle" },
],
});
expect(
warnSpy.mock.calls.some(([message]) =>
@@ -414,7 +422,11 @@ describe("WebSocket Server", () => {
expect(response.error).toBeUndefined();
expect(response.result).toEqual({
cwd: "/my/workspace",
keybindings: [],
keybindings: [
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
],
});
expect(
warnSpy.mock.calls.some(([message]) =>
@@ -445,7 +457,11 @@ describe("WebSocket Server", () => {
expect(response.error).toBeUndefined();
expect(response.result).toEqual({
cwd: "/my/workspace",
keybindings: [],
keybindings: [
{ key: "mod+j", command: "terminal.toggle" },
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
],
});
expect(
warnSpy.mock.calls.some(([message]) =>