MCPcopy Index your code
hub / github.com/anomalyco/opencode / resetForReplay

Function resetForReplay

packages/opencode/src/cli/cmd/run/runtime.lifecycle.ts:373–398  ·  view source on GitHub ↗
(next)

Source from the content-addressed store, hash-verified

371 return () => renderer.off(CliRenderEvents.RESIZE, resize)
372 },
373 async resetForReplay(next) {
374 if (closed || renderer.isDestroyed || footer.isClosed) {
375 throw new Error("runtime closed")
376 }
377
378 await footer.idle()
379 if (closed || renderer.isDestroyed || footer.isClosed) {
380 throw new Error("runtime closed")
381 }
382
383 footer.resetForReplay(true)
384 renderer.resetSplitFooterForReplay({ clearSavedLines: true })
385 const splash = splashInfo(next.sessionTitle ?? input.sessionTitle, next.history)
386 renderer.writeToScrollback(
387 entrySplash({
388 ...splashMeta({
389 title: splash.title,
390 session_id: next.sessionID ?? input.getSessionID?.() ?? input.sessionID,
391 }),
392 theme: footer.currentTheme().splash,
393 showSession: splash.showSession,
394 detail: directoryLabel(input.directory),
395 }),
396 )
397 renderer.requestRender()
398 },
399 close,
400 }
401 } catch (error) {

Callers

nothing calls this directly

Calls 8

entrySplashFunction · 0.90
splashMetaFunction · 0.90
splashInfoFunction · 0.85
directoryLabelFunction · 0.85
idleMethod · 0.80
resetForReplayMethod · 0.80
getSessionIDMethod · 0.80
currentThemeMethod · 0.80

Tested by

no test coverage detected