feat(cli): ring bell when task completes in TUI

Watch session status transitions to idle and write BEL
to bounce the dock icon / flash the taskbar.
This commit is contained in:
Alex Alecu
2026-03-18 14:13:38 +02:00
parent c626678d9a
commit 0e5941e2ea
@@ -84,6 +84,7 @@ import { UI } from "@/cli/ui.ts"
import { useTuiConfig } from "../../context/tui-config"
import { formatMarkdownTables } from "../../util/markdown" // kilocode_change
import { bell } from "@/kilocode/bell" // kilocode_change
addDefaultParsers(parsers.parsers)
@@ -149,6 +150,17 @@ export function Session() {
return messages().findLast((x) => x.role === "assistant")
})
// kilocode_change start - ring terminal bell on task completion
createEffect(
on(
() => sync.data.session_status?.[route.sessionID]?.type,
(type, prev) => {
if (prev && prev !== "idle" && type === "idle") bell()
},
),
)
// kilocode_change end
const dimensions = useTerminalDimensions()
const [sidebar, setSidebar] = kv.signal<"auto" | "hide">("sidebar", "auto")
const [sidebarOpen, setSidebarOpen] = createSignal(false)