From a520b7f4e1a6e65b270da18edae2f47a44524336 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 12 Oct 2022 05:39:30 +0200 Subject: [PATCH] fix: ensure a final render before a clean shutdown Fixes #274. --- tea.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tea.go b/tea.go index b94ca4e..1519ade 100644 --- a/tea.go +++ b/tea.go @@ -459,6 +459,9 @@ func (p *Program) Run() (Model, error) { killed := p.ctx.Err() != nil if killed { err = ErrProgramKilled + } else { + // Ensure we rendered the final state of the model. + p.renderer.write(model.View()) } // Tear down.