mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Capture both stdout and stderr from execa-spawned processes (#3073)
This commit is contained in:
parent
b51abf70f9
commit
49382b7d89
2 changed files with 13 additions and 4 deletions
5
.changeset/fifty-pumpkins-wave.md
Normal file
5
.changeset/fifty-pumpkins-wave.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Capture stderr in execa-spawned processes
|
||||
|
|
@ -38,13 +38,14 @@ export class ExecaTerminalProcess extends BaseTerminalProcess {
|
|||
shell: true,
|
||||
cwd: this.terminal.getCurrentWorkingDirectory(),
|
||||
cancelSignal: this.controller.signal,
|
||||
all: true,
|
||||
})`${command}`
|
||||
|
||||
this.terminal.setActiveStream(subprocess, subprocess.pid)
|
||||
this.emit("line", "")
|
||||
const stream = subprocess.iterable({ from: "all", preserveNewlines: true })
|
||||
this.terminal.setActiveStream(stream, subprocess.pid)
|
||||
|
||||
for await (const line of subprocess) {
|
||||
this.fullOutput += `${line}\n`
|
||||
for await (const line of stream) {
|
||||
this.fullOutput += line
|
||||
|
||||
const now = Date.now()
|
||||
|
||||
|
|
@ -62,6 +63,9 @@ export class ExecaTerminalProcess extends BaseTerminalProcess {
|
|||
console.error(`[ExecaTerminalProcess] shell execution error: ${error.message}`)
|
||||
this.emit("shell_execution_complete", { exitCode: error.exitCode ?? 0, signalName: error.signal })
|
||||
} else {
|
||||
console.error(
|
||||
`[ExecaTerminalProcess] shell execution error: ${error instanceof Error ? error.message : String(error)}`,
|
||||
)
|
||||
this.emit("shell_execution_complete", { exitCode: 1 })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue