summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/shellCommandProcessor.ts
diff options
context:
space:
mode:
authorGal Zahavi <[email protected]>2025-08-14 13:40:12 -0700
committerGitHub <[email protected]>2025-08-14 20:40:12 +0000
commit980091cbc2a809690dbd401c16ec3ac34da56083 (patch)
tree5bdadbdbebcaf6471f753ef31ef3fdc6a7716ae3 /packages/cli/src/ui/hooks/shellCommandProcessor.ts
parent48af0456c1883834a83ae74281f0c871129779d8 (diff)
feat(core): refactor shell execution to use node-pty (#6088)
Diffstat (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.ts')
-rw-r--r--packages/cli/src/ui/hooks/shellCommandProcessor.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts
index 08df0a74..537b21ac 100644
--- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts
@@ -104,7 +104,6 @@ export const useShellCommandProcessor = (
const execPromise = new Promise<void>((resolve) => {
let lastUpdateTime = Date.now();
let cumulativeStdout = '';
- let cumulativeStderr = '';
let isBinaryStream = false;
let binaryBytesReceived = 0;
@@ -142,11 +141,7 @@ export const useShellCommandProcessor = (
case 'data':
// Do not process text data if we've already switched to binary mode.
if (isBinaryStream) break;
- if (event.stream === 'stdout') {
- cumulativeStdout += event.chunk;
- } else {
- cumulativeStderr += event.chunk;
- }
+ cumulativeStdout = event.chunk;
break;
case 'binary_detected':
isBinaryStream = true;
@@ -172,9 +167,7 @@ export const useShellCommandProcessor = (
'[Binary output detected. Halting stream...]';
}
} else {
- currentDisplayOutput =
- cumulativeStdout +
- (cumulativeStderr ? `\n${cumulativeStderr}` : '');
+ currentDisplayOutput = cumulativeStdout;
}
// Throttle pending UI updates to avoid excessive re-renders.