diff --git a/KEYBINDINGS.md b/KEYBINDINGS.md index 16fce1a4d9f9016558ac4c7666b4390e68a72c87..a44f1f5f4ff997d13508a4ed7d28a4993d7b9d19 100644 --- a/KEYBINDINGS.md +++ b/KEYBINDINGS.md @@ -23,8 +23,9 @@ See the full schema for more details: [`packages/contracts/src/keybindings.ts`]( { "key": "mod+d", "command": "terminal.split", "when": "terminalFocus" }, { "key": "mod+n", "command": "terminal.new", "when": "terminalFocus" }, { "key": "mod+w", "command": "terminal.close", "when": "terminalFocus" }, - { "key": "mod+shift+o", "command": "chat.new" }, - { "key": "mod+shift+n", "command": "chat.newLocal" }, + { "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" }, + { "key": "mod+shift+o", "command": "chat.new", "when": "!terminalFocus" }, + { "key": "mod+shift+n", "command": "chat.newLocal", "when": "!terminalFocus" }, { "key": "mod+o", "command": "editor.openFavorite" } ] ``` diff --git a/apps/server/src/keybindings.test.ts b/apps/server/src/keybindings.test.ts index 364ebc4862cdf48d63f3a048fe0ea8460b0a7122..d761588e93872b3fa084d7cefde627f87a3728b5 100644 --- a/apps/server/src/keybindings.test.ts +++ b/apps/server/src/keybindings.test.ts @@ -1,10 +1,6 @@ import { assert, describe, it } from "vitest"; -import { - DEFAULT_KEYBINDINGS, - compileResolvedKeybindingRule, - parseKeybindingShortcut, -} from "./keybindings"; +import { compileResolvedKeybindingRule, parseKeybindingShortcut } from "./keybindings"; describe("server keybindings", () => { it("parses shortcuts including plus key", () => { @@ -70,16 +66,4 @@ describe("server keybindings", () => { }), ); }); - - it("defines defaults for terminal.close and chat.newLocal", () => { - assert.deepInclude(DEFAULT_KEYBINDINGS, { - key: "mod+w", - command: "terminal.close", - when: "terminalFocus", - }); - assert.deepInclude(DEFAULT_KEYBINDINGS, { - key: "mod+shift+n", - command: "chat.newLocal", - }); - }); }); diff --git a/apps/server/src/keybindings.ts b/apps/server/src/keybindings.ts index a78e25b31b6a67d5d00e1c0b28e2064c3a67ac5a..97e2de438ff79666a16cdbf60844a2fbbbaabd97 100644 --- a/apps/server/src/keybindings.ts +++ b/apps/server/src/keybindings.ts @@ -29,8 +29,9 @@ export const DEFAULT_KEYBINDINGS: ReadonlyArray = [ { key: "mod+d", command: "terminal.split", when: "terminalFocus" }, { key: "mod+n", command: "terminal.new", when: "terminalFocus" }, { key: "mod+w", command: "terminal.close", when: "terminalFocus" }, - { key: "mod+shift+o", command: "chat.new" }, - { key: "mod+shift+n", command: "chat.newLocal" }, + { key: "mod+n", command: "chat.new", when: "!terminalFocus" }, + { key: "mod+shift+o", command: "chat.new", when: "!terminalFocus" }, + { key: "mod+shift+n", command: "chat.newLocal", when: "!terminalFocus" }, { key: "mod+o", command: "editor.openFavorite" }, ];