fix(prompt): Make interactive command avoidance conditional (#11225)

This commit is contained in:
Gal Zahavi
2025-10-17 09:07:18 -07:00
committed by GitHub
parent be25e2cb96
commit 0ded546a09
6 changed files with 144 additions and 10 deletions
+11
View File
@@ -282,6 +282,7 @@ export interface ConfigParameters {
continueOnFailedApiCall?: boolean;
retryFetchErrors?: boolean;
enableShellOutputEfficiency?: boolean;
ptyInfo?: string;
}
export class Config {
@@ -352,6 +353,7 @@ export class Config {
private readonly loadMemoryFromIncludeDirectories: boolean = false;
private readonly chatCompression: ChatCompressionSettings | undefined;
private readonly interactive: boolean;
private readonly ptyInfo: string;
private readonly trustedFolder: boolean | undefined;
private readonly useRipgrep: boolean;
private readonly enableInteractiveShell: boolean;
@@ -448,6 +450,7 @@ export class Config {
params.loadMemoryFromIncludeDirectories ?? false;
this.chatCompression = params.chatCompression;
this.interactive = params.interactive ?? false;
this.ptyInfo = params.ptyInfo ?? 'child_process';
this.trustedFolder = params.trustedFolder;
this.useRipgrep = params.useRipgrep ?? true;
this.enableInteractiveShell = params.enableInteractiveShell ?? false;
@@ -959,6 +962,14 @@ export class Config {
return this.chatCompression;
}
isInteractiveShellEnabled(): boolean {
return (
this.interactive &&
this.ptyInfo !== 'child_process' &&
this.enableInteractiveShell
);
}
isInteractive(): boolean {
return this.interactive;
}