MCPcopy Index your code
hub / github.com/codeaashu/claude-code / useTabStatus

Function useTabStatus

src/ink/hooks/use-tab-status.ts:53–72  ·  view source on GitHub ↗
(kind: TabStatusKind | null)

Source from the content-addressed store, hash-verified

51 * a stale dot. Process-exit cleanup is handled by ink.tsx's unmount path.
52 */
53export function useTabStatus(kind: TabStatusKind | null): void {
54 const writeRaw = useContext(TerminalWriteContext)
55 const prevKindRef = useRef<TabStatusKind | null>(null)
56
57 useEffect(() => {
58 // When kind transitions from non-null to null (e.g. user toggles off
59 // showStatusInTerminalTab mid-session), clear the stale dot.
60 if (kind === null) {
61 if (prevKindRef.current !== null && writeRaw && supportsTabStatus()) {
62 writeRaw(wrapForMultiplexer(CLEAR_TAB_STATUS))
63 }
64 prevKindRef.current = null
65 return
66 }
67
68 prevKindRef.current = kind
69 if (!writeRaw || !supportsTabStatus()) return
70 writeRaw(wrapForMultiplexer(tabStatus(TAB_STATUS_PRESETS[kind])))
71 }, [kind, writeRaw])
72}
73

Callers 1

REPLFunction · 0.85

Calls 3

supportsTabStatusFunction · 0.85
wrapForMultiplexerFunction · 0.85
tabStatusFunction · 0.85

Tested by

no test coverage detected