Skip to content

Commit 21406b5

Browse files
committed
feat: add configurable keybindings via keybindings.json
Replace hardcoded keyboard shortcuts in keymodel.ts with a data-driven system. Default bindings are defined in defaultconfig/keybindings.json and users can override them in ~/.config/waveterm/keybindings.json. The merge logic preserves defaults while letting users remap or disable individual commands. A "Keybindings" section is added to the Wave Config UI for in-app editing. Changes are picked up automatically via the file watcher.
1 parent a4447c1 commit 21406b5

9 files changed

Lines changed: 600 additions & 249 deletions

File tree

frontend/app/store/global.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
} from "@/util/util";
3030
import { atom, Atom, PrimitiveAtom, useAtomValue } from "jotai";
3131
import { setupBadgesSubscription } from "./badge";
32+
import { reregisterGlobalKeys } from "./keymodel";
3233
import { atoms, blockComponentModelMap, ConnStatusMapAtom, initGlobalAtoms, orefAtomCache } from "./global-atoms";
3334
import { globalStore } from "./jotaiStore";
3435
import { modalsModel } from "./modalmodel";
@@ -65,6 +66,7 @@ function initGlobalWaveEventSubs(initOpts: WaveInitOpts) {
6566
handler: (event) => {
6667
// console.log("config wave event handler", event);
6768
globalStore.set(atoms.fullConfigAtom, event.data.fullconfig);
69+
reregisterGlobalKeys();
6870
},
6971
});
7072
waveEventSubscribeSingle({

0 commit comments

Comments
 (0)