mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 09:01:17 -07:00
fix(patch): cherry-pick 828afe1 to release/v0.20.0-preview.1-pr-14159 to patch version v0.20.0-preview.1 and create version 0.20.0-preview.2 (#14733)
Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
@@ -13,6 +13,11 @@ import stripAnsi from 'strip-ansi';
|
||||
|
||||
export class TextOutput {
|
||||
private atStartOfLine = true;
|
||||
private outputStream: NodeJS.WriteStream;
|
||||
|
||||
constructor(outputStream: NodeJS.WriteStream = process.stdout) {
|
||||
this.outputStream = outputStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a string to stdout.
|
||||
@@ -22,7 +27,7 @@ export class TextOutput {
|
||||
if (str.length === 0) {
|
||||
return;
|
||||
}
|
||||
process.stdout.write(str);
|
||||
this.outputStream.write(str);
|
||||
const strippedStr = stripAnsi(str);
|
||||
if (strippedStr.length > 0) {
|
||||
this.atStartOfLine = strippedStr.endsWith('\n');
|
||||
|
||||
Reference in New Issue
Block a user