MCPcopy Create free account
hub / github.com/anomalyco/opencode / scheduleSize

Function scheduleSize

packages/app/src/components/terminal.tsx:267–290  ·  view source on GitHub ↗
(cols: number, rows: number)

Source from the content-addressed store, hash-verified

265 }
266
267 const scheduleSize = (cols: number, rows: number) => {
268 if (disposed) return
269 if (lastSize?.cols === cols && lastSize?.rows === rows) return
270
271 pendingSize = { cols, rows }
272
273 if (!lastSize) {
274 lastSize = pendingSize
275 void pushSize(cols, rows)
276 return
277 }
278
279 if (sizeTimer !== undefined) return
280 sizeTimer = setTimeout(() => {
281 sizeTimer = undefined
282 const next = pendingSize
283 if (!next) return
284 pendingSize = undefined
285 if (disposed) return
286 if (lastSize?.cols === next.cols && lastSize?.rows === next.rows) return
287 lastSize = next
288 void pushSize(next.cols, next.rows)
289 }, 100)
290 }
291
292 createEffect(() => {
293 const colors = terminalColors()

Callers 2

runFunction · 0.85
handleOpenFunction · 0.85

Calls 1

pushSizeFunction · 0.85

Tested by

no test coverage detected