feat(cli): sanitize ANSI escape sequences in non-interactive output (#17172)

This commit is contained in:
Sehoon Shon
2026-01-20 23:58:37 -05:00
committed by GitHub
parent 367e7bf401
commit 7990073543
5 changed files with 301 additions and 3 deletions
+14
View File
@@ -378,6 +378,8 @@ export interface ConfigParameters {
recordResponses?: string;
ptyInfo?: string;
disableYoloMode?: boolean;
rawOutput?: boolean;
acceptRawOutputRisk?: boolean;
modelConfigServiceConfig?: ModelConfigServiceConfig;
enableHooks?: boolean;
enableHooksUI?: boolean;
@@ -520,6 +522,8 @@ export class Config {
readonly fakeResponses?: string;
readonly recordResponses?: string;
private readonly disableYoloMode: boolean;
private readonly rawOutput: boolean;
private readonly acceptRawOutputRisk: boolean;
private pendingIncludeDirectories: string[];
private readonly enableHooks: boolean;
private readonly enableHooksUI: boolean;
@@ -722,6 +726,8 @@ export class Config {
};
this.retryFetchErrors = params.retryFetchErrors ?? false;
this.disableYoloMode = params.disableYoloMode ?? false;
this.rawOutput = params.rawOutput ?? false;
this.acceptRawOutputRisk = params.acceptRawOutputRisk ?? false;
if (params.hooks) {
this.hooks = params.hooks;
@@ -1395,6 +1401,14 @@ export class Config {
return this.disableYoloMode || !this.isTrustedFolder();
}
getRawOutput(): boolean {
return this.rawOutput;
}
getAcceptRawOutputRisk(): boolean {
return this.acceptRawOutputRisk;
}
getPendingIncludeDirectories(): string[] {
return this.pendingIncludeDirectories;
}