Compare commits

...

1 Commits

Author SHA1 Message Date
Aiden Cline 047d9255ce fix(tui): hide background badge on interrupted shells 2026-08-12 15:08:36 +00:00
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -286,6 +286,7 @@ export const Plugin = {
output,
content,
metadata: {
status: output.status,
truncated: output.truncated,
...("exit" in output && output.exit !== undefined ? { exit: output.exit } : {}),
...("shellID" in output && output.shellID !== undefined ? { shellID: output.shellID } : {}),
+2 -2
View File
@@ -667,7 +667,7 @@ describe("ShellTool", () => {
)
const settled = yield* executeTool(registry, call({ command: idleCommand, timeout: 50, background: true }))
const shellID = typeof settled.metadata?.shellID === "string" ? settled.metadata.shellID : undefined
expect(settled.metadata).toMatchObject({ truncated: false })
expect(settled.metadata).toMatchObject({ status: "running", truncated: false })
expect(shellID).toStartWith("sh_")
const shell = yield* Shell.Service
@@ -752,7 +752,7 @@ describe("ShellTool", () => {
expect(yield* backgroundWhenReady()).toMatchObject([{ id: "call-background-signal", type: "shell" }])
const settled = yield* Fiber.join(waiting)
const shellID = typeof settled.metadata?.shellID === "string" ? settled.metadata.shellID : undefined
expect(settled.metadata).toMatchObject({ truncated: false })
expect(settled.metadata).toMatchObject({ status: "running", truncated: false })
expect(settled.content?.[0]).toEqual({
type: "text",
text: "The command was moved to the background.",
+3 -1
View File
@@ -2779,7 +2779,9 @@ function Shell(props: ToolProps) {
const permission = useToolPermission(() => props.part)
const color = createMemo(() => (permission() ? theme.text.feedback.warning.default : theme.text.default))
const shellID = createMemo(() => stringValue(props.metadata.shellID))
const background = createMemo(() => Boolean(shellID()) && props.part.state.status !== "running")
const background = createMemo(
() => props.part.state.status === "completed" && props.metadata.status === "running",
)
const backgroundRunning = createMemo(() => {
const id = shellID()
return Boolean(id && data.shell.get(id))