fix(coding-agent): reload keybindings on /reload closes #2309

This commit is contained in:
Mario Zechner
2026-03-17 23:59:45 +01:00
parent 3dd63848a0
commit 7eb55b08cf
5 changed files with 45 additions and 22 deletions

View File

@@ -3794,9 +3794,14 @@ export class InteractiveMode {
this.resetExtensionUI();
const loader = new BorderedLoader(this.ui, theme, "Reloading extensions, skills, prompts, themes...", {
cancellable: false,
});
const loader = new BorderedLoader(
this.ui,
theme,
"Reloading keybindings, extensions, skills, prompts, themes...",
{
cancellable: false,
},
);
const previousEditor = this.editor;
this.editorContainer.clear();
this.editorContainer.addChild(loader);
@@ -3813,6 +3818,7 @@ export class InteractiveMode {
try {
await this.session.reload();
this.keybindings.reload();
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
const themeName = this.settingsManager.getTheme();
@@ -3846,7 +3852,7 @@ export class InteractiveMode {
if (modelsJsonError) {
this.showError(`models.json error: ${modelsJsonError}`);
}
this.showStatus("Reloaded extensions, skills, prompts, themes");
this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
} catch (error) {
dismissLoader(previousEditor as Component);
this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
@@ -4084,6 +4090,10 @@ export class InteractiveMode {
private handleHotkeysCommand(): void {
// Navigation keybindings
const cursorUp = this.getEditorKeyDisplay("cursorUp");
const cursorDown = this.getEditorKeyDisplay("cursorDown");
const cursorLeft = this.getEditorKeyDisplay("cursorLeft");
const cursorRight = this.getEditorKeyDisplay("cursorRight");
const cursorWordLeft = this.getEditorKeyDisplay("cursorWordLeft");
const cursorWordRight = this.getEditorKeyDisplay("cursorWordRight");
const cursorLineStart = this.getEditorKeyDisplay("cursorLineStart");
@@ -4116,14 +4126,16 @@ export class InteractiveMode {
const expandTools = this.getAppKeyDisplay("expandTools");
const toggleThinking = this.getAppKeyDisplay("toggleThinking");
const externalEditor = this.getAppKeyDisplay("externalEditor");
const cycleModelBackward = this.getAppKeyDisplay("cycleModelBackward");
const followUp = this.getAppKeyDisplay("followUp");
const dequeue = this.getAppKeyDisplay("dequeue");
const pasteImage = this.getAppKeyDisplay("pasteImage");
let hotkeys = `
**Navigation**
| Key | Action |
|-----|--------|
| \`Arrow keys\` | Move cursor / browse history (Up when empty) |
| \`${cursorUp}\` / \`${cursorDown}\` / \`${cursorLeft}\` / \`${cursorRight}\` | Move cursor / browse history (Up when empty) |
| \`${cursorWordLeft}\` / \`${cursorWordRight}\` | Move by word |
| \`${cursorLineStart}\` | Start of line |
| \`${cursorLineEnd}\` | End of line |
@@ -4153,14 +4165,14 @@ export class InteractiveMode {
| \`${exit}\` | Exit (when editor is empty) |
| \`${suspend}\` | Suspend to background |
| \`${cycleThinkingLevel}\` | Cycle thinking level |
| \`${cycleModelForward}\` | Cycle models |
| \`${cycleModelForward}\` / \`${cycleModelBackward}\` | Cycle models |
| \`${selectModel}\` | Open model selector |
| \`${expandTools}\` | Toggle tool output expansion |
| \`${toggleThinking}\` | Toggle thinking block visibility |
| \`${externalEditor}\` | Edit message in external editor |
| \`${followUp}\` | Queue follow-up message |
| \`${dequeue}\` | Restore queued messages |
| \`Ctrl+V\` | Paste image from clipboard |
| \`${pasteImage}\` | Paste image from clipboard |
| \`/\` | Slash commands |
| \`!\` | Run bash command |
| \`!!\` | Run bash command (excluded from context) |