diff options
| author | Gal Zahavi <[email protected]> | 2025-08-15 10:27:33 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-15 17:27:33 +0000 |
| commit | 1a2906a8ad6e9cf7a68441c956af91d189eff417 (patch) | |
| tree | 599da5522cfa33c30793d57a73fd4ff93ab50daf /packages/cli/src/ui/hooks/shellCommandProcessor.ts | |
| parent | ab1c483cab659ac2ab081e74a0e3bd0fcc48a734 (diff) | |
Revert #6088 (#6328)
Diffstat (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/shellCommandProcessor.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 537b21ac..08df0a74 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -104,6 +104,7 @@ export const useShellCommandProcessor = ( const execPromise = new Promise<void>((resolve) => { let lastUpdateTime = Date.now(); let cumulativeStdout = ''; + let cumulativeStderr = ''; let isBinaryStream = false; let binaryBytesReceived = 0; @@ -141,7 +142,11 @@ export const useShellCommandProcessor = ( case 'data': // Do not process text data if we've already switched to binary mode. if (isBinaryStream) break; - cumulativeStdout = event.chunk; + if (event.stream === 'stdout') { + cumulativeStdout += event.chunk; + } else { + cumulativeStderr += event.chunk; + } break; case 'binary_detected': isBinaryStream = true; @@ -167,7 +172,9 @@ export const useShellCommandProcessor = ( '[Binary output detected. Halting stream...]'; } } else { - currentDisplayOutput = cumulativeStdout; + currentDisplayOutput = + cumulativeStdout + + (cumulativeStderr ? `\n${cumulativeStderr}` : ''); } // Throttle pending UI updates to avoid excessive re-renders. |
