mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-24 21:10:43 -07:00
improve performance of shell commands with lots of output (#7680)
This commit is contained in:
@@ -348,7 +348,6 @@ export class ShellExecutionService {
|
||||
});
|
||||
let processingChain = Promise.resolve();
|
||||
let decoder: TextDecoder | null = null;
|
||||
let output = '';
|
||||
const outputChunks: Buffer[] = [];
|
||||
const error: Error | null = null;
|
||||
let exited = false;
|
||||
@@ -385,9 +384,10 @@ export class ShellExecutionService {
|
||||
if (isStreamingRawContent) {
|
||||
const decodedChunk = decoder.decode(data, { stream: true });
|
||||
headlessTerminal.write(decodedChunk, () => {
|
||||
const newStrippedOutput = getFullText(headlessTerminal);
|
||||
output = newStrippedOutput;
|
||||
onOutputEvent({ type: 'data', chunk: newStrippedOutput });
|
||||
onOutputEvent({
|
||||
type: 'data',
|
||||
chunk: stripAnsi(decodedChunk),
|
||||
});
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
@@ -420,7 +420,7 @@ export class ShellExecutionService {
|
||||
|
||||
resolve({
|
||||
rawOutput: finalBuffer,
|
||||
output,
|
||||
output: getFullText(headlessTerminal),
|
||||
exitCode,
|
||||
signal: signal ?? null,
|
||||
error,
|
||||
|
||||
Reference in New Issue
Block a user