Skip to content

Commit 0e8c335

Browse files
monotykamaryopencodethdxr
authored
combine stdout and stderr in bash tool output (anomalyco#300)
Co-authored-by: opencode <[email protected]> Co-authored-by: Dax Raad <[email protected]>
1 parent 37e0a70 commit 0e8c335

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/opencode/src/tool/bash.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@ export const BashTool = Tool.define({
6363
metadata: {
6464
stderr,
6565
stdout,
66+
exit: process.exitCode,
6667
description: params.description,
6768
title: params.command,
6869
},
69-
output: stdout.replaceAll(/\x1b\[[0-9;]*m/g, ""),
70+
output: [
71+
`<stdout>`,
72+
stdout ?? "",
73+
`</stdout>`,
74+
`<stderr>`,
75+
stderr ?? "",
76+
`</stderr>`,
77+
].join("\n"),
7078
}
7179
},
7280
})

0 commit comments

Comments
 (0)