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

Function setTerminalFocused

src/ink/terminal-focus-state.ts:12–24  ·  view source on GitHub ↗
(v: boolean)

Source from the content-addressed store, hash-verified

10const subscribers: Set<() => void> = new Set()
11
12export function setTerminalFocused(v: boolean): void {
13 focusState = v ? 'focused' : 'blurred'
14 // Notify useSyncExternalStore subscribers
15 for (const cb of subscribers) {
16 cb()
17 }
18 if (!v) {
19 for (const resolve of resolvers) {
20 resolve()
21 }
22 resolvers.clear()
23 }
24}
25
26export function getTerminalFocused(): boolean {
27 return focusState !== 'blurred'

Callers 2

AppClass · 0.85
processKeysInBatchFunction · 0.85

Calls 2

resolveFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected