Skip to content

Commit 3659236

Browse files
(fix)chat: fix the bash output is not formatted (aws#6907)
## Problem When the excutable command fails, the output is not formatted. ## Solution Format the stderr the same as stdout. ![image](https://github.com/user-attachments/assets/ea2ac8e0-ca0e-4097-9bc6-d0b1989c9323) ![image](https://github.com/user-attachments/assets/649ff4c1-2333-48de-9d2b-a2b63e66436c) --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 462df07 commit 3659236

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/codewhispererChat/tools/executeBash.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ export class ExecuteBash {
232232
const stderrBuffer: string[] = []
233233

234234
let firstChunk = true
235+
let firstStderrChunk = true
235236
const childProcessOptions: ChildProcessOptions = {
236237
spawnOptions: {
237238
cwd: this.workingDirectory,
@@ -244,7 +245,8 @@ export class ExecuteBash {
244245
firstChunk = false
245246
},
246247
onStderr: (chunk: string) => {
247-
ExecuteBash.handleChunk(chunk, stderrBuffer, updates)
248+
ExecuteBash.handleChunk(firstStderrChunk ? '```console\n' + chunk : chunk, stderrBuffer, updates)
249+
firstStderrChunk = false
248250
},
249251
}
250252

0 commit comments

Comments
 (0)