mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 23:01:30 +00:00
feat(coding-agent): add "none" option to doubleEscapeAction setting
Allows disabling double-escape behavior entirely for users who accidentally trigger the tree/fork selector. Fixes #973
This commit is contained in:
parent
0587f045d9
commit
cb08758696
4 changed files with 51 additions and 25 deletions
|
|
@ -35,7 +35,7 @@ export interface SettingsConfig {
|
|||
availableThemes: string[];
|
||||
hideThinkingBlock: boolean;
|
||||
collapseChangelog: boolean;
|
||||
doubleEscapeAction: "fork" | "tree";
|
||||
doubleEscapeAction: "fork" | "tree" | "none";
|
||||
showHardwareCursor: boolean;
|
||||
editorPaddingX: number;
|
||||
autocompleteMaxVisible: number;
|
||||
|
|
@ -55,7 +55,7 @@ export interface SettingsCallbacks {
|
|||
onThemePreview?: (theme: string) => void;
|
||||
onHideThinkingBlockChange: (hidden: boolean) => void;
|
||||
onCollapseChangelogChange: (collapsed: boolean) => void;
|
||||
onDoubleEscapeActionChange: (action: "fork" | "tree") => void;
|
||||
onDoubleEscapeActionChange: (action: "fork" | "tree" | "none") => void;
|
||||
onShowHardwareCursorChange: (enabled: boolean) => void;
|
||||
onEditorPaddingXChange: (padding: number) => void;
|
||||
onAutocompleteMaxVisibleChange: (maxVisible: number) => void;
|
||||
|
|
@ -186,7 +186,7 @@ export class SettingsSelectorComponent extends Container {
|
|||
label: "Double-escape action",
|
||||
description: "Action when pressing Escape twice with empty editor",
|
||||
currentValue: config.doubleEscapeAction,
|
||||
values: ["tree", "fork"],
|
||||
values: ["tree", "fork", "none"],
|
||||
},
|
||||
{
|
||||
id: "thinking",
|
||||
|
|
|
|||
|
|
@ -1740,17 +1740,20 @@ export class InteractiveMode {
|
|||
this.isBashMode = false;
|
||||
this.updateEditorBorderColor();
|
||||
} else if (!this.editor.getText().trim()) {
|
||||
// Double-escape with empty editor triggers /tree or /fork based on setting
|
||||
const now = Date.now();
|
||||
if (now - this.lastEscapeTime < 500) {
|
||||
if (this.settingsManager.getDoubleEscapeAction() === "tree") {
|
||||
this.showTreeSelector();
|
||||
// Double-escape with empty editor triggers /tree, /fork, or nothing based on setting
|
||||
const action = this.settingsManager.getDoubleEscapeAction();
|
||||
if (action !== "none") {
|
||||
const now = Date.now();
|
||||
if (now - this.lastEscapeTime < 500) {
|
||||
if (action === "tree") {
|
||||
this.showTreeSelector();
|
||||
} else {
|
||||
this.showUserMessageSelector();
|
||||
}
|
||||
this.lastEscapeTime = 0;
|
||||
} else {
|
||||
this.showUserMessageSelector();
|
||||
this.lastEscapeTime = now;
|
||||
}
|
||||
this.lastEscapeTime = 0;
|
||||
} else {
|
||||
this.lastEscapeTime = now;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue