Skip to content

Commit d464c5b

Browse files
mswiszczclaude
andcommitted
feat: add JSON schema and WaveConfig sidebar entry for keybindings
Add keybindings.json schema with all valid action IDs (including unbind variants) for Monaco autocomplete, and register it in schemaendpoints. Add Keybindings entry to the WaveConfig sidebar after General settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2c0ba0b commit d464c5b

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

frontend/app/monaco/schemaendpoints.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import aipresetsSchema from "../../../schema/aipresets.json";
55
import backgroundsSchema from "../../../schema/backgrounds.json";
66
import connectionsSchema from "../../../schema/connections.json";
7+
import keybindingsSchema from "../../../schema/keybindings.json";
78
import settingsSchema from "../../../schema/settings.json";
89
import waveaiSchema from "../../../schema/waveai.json";
910
import widgetsSchema from "../../../schema/widgets.json";
@@ -45,6 +46,11 @@ const MonacoSchemas: SchemaInfo[] = [
4546
fileMatch: ["*/WAVECONFIGPATH/widgets.json"],
4647
schema: widgetsSchema,
4748
},
49+
{
50+
uri: "wave://schema/keybindings.json",
51+
fileMatch: ["*/WAVECONFIGPATH/keybindings.json"],
52+
schema: keybindingsSchema,
53+
},
4854
];
4955

5056
export { MonacoSchemas };

frontend/app/view/waveconfig/waveconfig-model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ function makeConfigFiles(isWindows: boolean): ConfigFile[] {
6464
docsUrl: "https://docs.waveterm.dev/config",
6565
hasJsonView: true,
6666
},
67+
{
68+
name: "Keybindings",
69+
path: "keybindings.json",
70+
language: "json",
71+
description: "Custom keyboard shortcuts",
72+
hasJsonView: true,
73+
},
6774
{
6875
name: "Connections",
6976
path: "connections.json",

schema/keybindings.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/wavetermdev/waveterm/schema/keybindings",
4+
"type": "array",
5+
"items": {
6+
"type": "object",
7+
"properties": {
8+
"key": {
9+
"oneOf": [
10+
{ "type": "string" },
11+
{ "type": "null" }
12+
],
13+
"description": "Key combination using colon-separated format. Modifiers: Cmd, Ctrl, Shift, Alt, Meta. Special keys: ArrowUp/Down/Left/Right, Home, End, Escape, Enter, Tab, Space, Backspace, Delete. Set to null to unbind."
14+
},
15+
"command": {
16+
"type": "string",
17+
"description": "Action ID. Prefix with - to unbind a default keybinding.",
18+
"enum": [
19+
"tab:new", "tab:close", "tab:prev", "tab:next",
20+
"tab:switchTo1", "tab:switchTo2", "tab:switchTo3", "tab:switchTo4", "tab:switchTo5",
21+
"tab:switchTo6", "tab:switchTo7", "tab:switchTo8", "tab:switchTo9",
22+
"block:new", "block:close", "block:splitRight", "block:splitDown",
23+
"block:magnify", "block:refocus",
24+
"block:navUp", "block:navDown", "block:navLeft", "block:navRight",
25+
"block:switchTo1", "block:switchTo2", "block:switchTo3", "block:switchTo4", "block:switchTo5",
26+
"block:switchTo6", "block:switchTo7", "block:switchTo8", "block:switchTo9", "block:switchToAI",
27+
"block:replaceWithLauncher",
28+
"block:splitChord", "block:splitChordUp", "block:splitChordDown", "block:splitChordLeft", "block:splitChordRight",
29+
"app:search", "app:openConnection", "app:toggleAIPanel", "app:toggleWidgetsSidebar",
30+
"term:toggleMultiInput",
31+
"generic:cancel",
32+
"-tab:new", "-tab:close", "-tab:prev", "-tab:next",
33+
"-tab:switchTo1", "-tab:switchTo2", "-tab:switchTo3", "-tab:switchTo4", "-tab:switchTo5",
34+
"-tab:switchTo6", "-tab:switchTo7", "-tab:switchTo8", "-tab:switchTo9",
35+
"-block:new", "-block:close", "-block:splitRight", "-block:splitDown",
36+
"-block:magnify", "-block:refocus",
37+
"-block:navUp", "-block:navDown", "-block:navLeft", "-block:navRight",
38+
"-block:switchTo1", "-block:switchTo2", "-block:switchTo3", "-block:switchTo4", "-block:switchTo5",
39+
"-block:switchTo6", "-block:switchTo7", "-block:switchTo8", "-block:switchTo9", "-block:switchToAI",
40+
"-block:replaceWithLauncher",
41+
"-block:splitChord", "-block:splitChordUp", "-block:splitChordDown", "-block:splitChordLeft", "-block:splitChordRight",
42+
"-app:search", "-app:openConnection", "-app:toggleAIPanel", "-app:toggleWidgetsSidebar",
43+
"-term:toggleMultiInput",
44+
"-generic:cancel"
45+
]
46+
}
47+
},
48+
"required": ["command"],
49+
"additionalProperties": false
50+
}
51+
}

0 commit comments

Comments
 (0)