fix(cli): gemini command stuck in git bash (#6397)

Co-authored-by: Arya Gummadi <aryagummadi@google.com>
This commit is contained in:
Sudheer Tripathi
2025-08-23 05:49:20 +05:30
committed by GitHub
parent da73f13d02
commit d89f7ea9b5
5 changed files with 198 additions and 78 deletions

View File

@@ -177,7 +177,9 @@ export class TestRig {
}
run(
promptOrOptions: string | { prompt?: string; stdin?: string },
promptOrOptions:
| string
| { prompt?: string; stdin?: string; stdinDoesNotEnd?: boolean },
...args: string[]
): Promise<string> {
let command = `node ${this.bundlePath} --yolo`;
@@ -221,7 +223,13 @@ export class TestRig {
if (execOptions.input) {
child.stdin!.write(execOptions.input);
}
child.stdin!.end();
if (
typeof promptOrOptions === 'object' &&
!promptOrOptions.stdinDoesNotEnd
) {
child.stdin!.end();
}
child.stdout!.on('data', (data: Buffer) => {
stdout += data;