mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
refactor(core,cli): useAlternateBuffer read from config (#20346)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -941,6 +941,31 @@ describe('Server Config (config.ts)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('UseAlternateBuffer Configuration', () => {
|
||||
it('should default useAlternateBuffer to false when not provided', () => {
|
||||
const config = new Config(baseParams);
|
||||
expect(config.getUseAlternateBuffer()).toBe(false);
|
||||
});
|
||||
|
||||
it('should set useAlternateBuffer to true when provided as true', () => {
|
||||
const paramsWithAlternateBuffer: ConfigParameters = {
|
||||
...baseParams,
|
||||
useAlternateBuffer: true,
|
||||
};
|
||||
const config = new Config(paramsWithAlternateBuffer);
|
||||
expect(config.getUseAlternateBuffer()).toBe(true);
|
||||
});
|
||||
|
||||
it('should set useAlternateBuffer to false when explicitly provided as false', () => {
|
||||
const paramsWithAlternateBuffer: ConfigParameters = {
|
||||
...baseParams,
|
||||
useAlternateBuffer: false,
|
||||
};
|
||||
const config = new Config(paramsWithAlternateBuffer);
|
||||
expect(config.getUseAlternateBuffer()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('UseWriteTodos Configuration', () => {
|
||||
it('should default useWriteTodos to true when not provided', () => {
|
||||
const config = new Config(baseParams);
|
||||
|
||||
@@ -519,6 +519,7 @@ export interface ConfigParameters {
|
||||
interactive?: boolean;
|
||||
trustedFolder?: boolean;
|
||||
useBackgroundColor?: boolean;
|
||||
useAlternateBuffer?: boolean;
|
||||
useRipgrep?: boolean;
|
||||
enableInteractiveShell?: boolean;
|
||||
skipNextSpeakerCheck?: boolean;
|
||||
@@ -702,6 +703,7 @@ export class Config {
|
||||
private readonly enableInteractiveShell: boolean;
|
||||
private readonly skipNextSpeakerCheck: boolean;
|
||||
private readonly useBackgroundColor: boolean;
|
||||
private readonly useAlternateBuffer: boolean;
|
||||
private shellExecutionConfig: ShellExecutionConfig;
|
||||
private readonly extensionManagement: boolean = true;
|
||||
private readonly truncateToolOutputThreshold: number;
|
||||
@@ -900,6 +902,7 @@ export class Config {
|
||||
this.directWebFetch = params.directWebFetch ?? false;
|
||||
this.useRipgrep = params.useRipgrep ?? true;
|
||||
this.useBackgroundColor = params.useBackgroundColor ?? true;
|
||||
this.useAlternateBuffer = params.useAlternateBuffer ?? false;
|
||||
this.enableInteractiveShell = params.enableInteractiveShell ?? false;
|
||||
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
|
||||
this.shellExecutionConfig = {
|
||||
@@ -2521,6 +2524,10 @@ export class Config {
|
||||
return this.useBackgroundColor;
|
||||
}
|
||||
|
||||
getUseAlternateBuffer(): boolean {
|
||||
return this.useAlternateBuffer;
|
||||
}
|
||||
|
||||
getEnableInteractiveShell(): boolean {
|
||||
return this.enableInteractiveShell;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user