Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cli/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
SHELL_TOOL_NAMES,
resolveTelemetrySettings,
FatalConfigError,
getPty,
} from '@google/gemini-cli-core';
import type { Settings } from './settings.js';

Expand Down Expand Up @@ -684,6 +685,9 @@ export async function loadCliConfig(
argv.screenReader !== undefined
? argv.screenReader
: (settings.ui?.accessibility?.screenReader ?? false);

const ptyInfo = await getPty();

return new Config({
sessionId,
embeddingModel: DEFAULT_GEMINI_EMBEDDING_MODEL,
Expand Down Expand Up @@ -761,6 +765,7 @@ export async function loadCliConfig(
codebaseInvestigatorSettings:
settings.experimental?.codebaseInvestigatorSettings,
retryFetchErrors: settings.general?.retryFetchErrors ?? false,
ptyInfo: ptyInfo?.name,
});
}

Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export interface ConfigParameters {
continueOnFailedApiCall?: boolean;
retryFetchErrors?: boolean;
enableShellOutputEfficiency?: boolean;
ptyInfo?: string;
}

export class Config {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -963,6 +966,14 @@ export class Config {
return this.chatCompression;
}

isInteractiveShellEnabled(): boolean {
return (
this.interactive &&
this.ptyInfo !== 'child_process' &&
this.enableInteractiveShell
);
}

isInteractive(): boolean {
return this.interactive;
}
Expand Down
Loading