MCPcopy Create free account
hub / github.com/charmbracelet/bubbletea / flushFrame

Method flushFrame

tea.go:1661–1674  ·  view source on GitHub ↗

flushFrame writes the queued output and the current frame, and reports whether a frame was drawn. If the renderer panics, ok is false and the panic is recovered so the terminal still gets restored. The recovery runs on another goroutine: shutting down sends on rendererDone, which only the renderer g

()

Source from the content-addressed store, hash-verified

1659// another goroutine: shutting down sends on rendererDone, which only the
1660// renderer goroutine calling flushFrame receives.
1661func (p *Program) flushFrame() (drew, ok bool) {
1662 if !p.disableCatchPanics {
1663 defer func() {
1664 if r := recover(); r != nil {
1665 ok = false
1666 go p.recoverFromGoPanicWithStack(r, debug.Stack())
1667 }
1668 }()
1669 }
1670 p.keepWriteErr(p.flush())
1671 drew, err := p.renderer.flush(false)
1672 p.keepWriteErr(err)
1673 return drew, true
1674}
1675
1676// stopRenderer stops the renderer.
1677// If kill is true, the renderer will be stopped immediately without flushing

Callers 1

startRendererMethod · 0.95

Calls 4

keepWriteErrMethod · 0.95
flushMethod · 0.95
flushMethod · 0.65

Tested by

no test coverage detected