log bash output when using `opencode run` (#2595)

pull/2602/head
Tommy D. Rossi 2025-09-14 16:03:40 +02:00 committed by GitHub
parent c81624aef7
commit 4bf0541bd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -145,6 +145,7 @@ export const RunCommand = cmd({
}
let text = ""
Bus.subscribe(MessageV2.Event.PartUpdated, async (evt) => {
if (evt.properties.part.sessionID !== session.id) return
if (evt.properties.part.messageID === messageID) return
@ -155,7 +156,13 @@ export const RunCommand = cmd({
const title =
part.state.title ||
(Object.keys(part.state.input).length > 0 ? JSON.stringify(part.state.input) : "Unknown")
printEvent(color, tool, title)
if (part.tool === "bash" && part.state.output && part.state.output.trim()) {
UI.println()
UI.println(part.state.output)
}
}
if (part.type === "text") {