diff --git a/KEYBINDINGS.md b/KEYBINDINGS.md index 16fce1a4d9..a44f1f5f4f 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 364ebc4862..d761588e93 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 a78e25b31b..97e2de438f 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" }, ];