feat(coding-agent): configurable double-escape action (tree vs branch)

Add doubleEscapeAction setting to choose whether double-escape with an
empty editor opens /tree (default) or /branch.

- Add setting to Settings interface and SettingsManager
- Add to /settings UI for easy toggling
- Update interactive-mode to respect the setting
- Document in README.md settings table

fixes #404
This commit is contained in:
Mario Zechner 2026-01-03 01:59:08 +01:00
parent 17b3a14bfa
commit 42b1e06ad1
6 changed files with 34 additions and 6 deletions

View file

@ -58,6 +58,7 @@ export interface Settings {
terminal?: TerminalSettings;
images?: ImageSettings;
enabledModels?: string[]; // Model patterns for cycling (same format as --models CLI flag)
doubleEscapeAction?: "branch" | "tree"; // Action for double-escape with empty editor (default: "tree")
}
/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */
@ -410,4 +411,13 @@ export class SettingsManager {
getEnabledModels(): string[] | undefined {
return this.settings.enabledModels;
}
getDoubleEscapeAction(): "branch" | "tree" {
return this.settings.doubleEscapeAction ?? "tree";
}
setDoubleEscapeAction(action: "branch" | "tree"): void {
this.globalSettings.doubleEscapeAction = action;
this.save();
}
}