mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Fix a race where artifacts could print when exiting a program
This commit also consolidates the exit operations for consistency's sake, and adds a kill() method to renderers for stopping them without performing any final rendering.
This commit is contained in:
16
renderer.go
16
renderer.go
@@ -2,10 +2,26 @@ package tea
|
||||
|
||||
// renderer is the interface for Bubble Tea renderers.
|
||||
type renderer interface {
|
||||
// Start the renderer.
|
||||
start()
|
||||
|
||||
// Stop the renderer, but render the final frame in the buffer, if any.
|
||||
stop()
|
||||
|
||||
// Stop the renderer without doing any final rendering.
|
||||
kill()
|
||||
|
||||
// Write a frame to the renderer. The renderer can write this data to ouput
|
||||
// at its discretion.
|
||||
write(string)
|
||||
|
||||
// Request a full re-render.
|
||||
repaint()
|
||||
|
||||
// Whether or not the alternate screen buffer is enabled.
|
||||
altScreen() bool
|
||||
|
||||
// Record internally that the alternate screen buffer is enabled. This does
|
||||
// should not actually toggle the alternate screen buffer.
|
||||
setAltScreen(bool)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user