fix: timeout when waiting for CancelReader

Fixes #524.
This commit is contained in:
Christian Muehlhaeuser
2022-10-11 09:26:34 +02:00
parent b9bd01b79a
commit 8703897aad
2 changed files with 1 additions and 7 deletions

3
tea.go
View File

@@ -446,7 +446,6 @@ func (p *Program) Run() (Model, error) {
return model, err
}
defer p.cancelReader.Close() //nolint:errcheck
handlers.add(p.readLoopDone)
}
// Handle resize events.
@@ -546,7 +545,7 @@ func (p *Program) shutdown(kill bool) {
// reader. You can return control to the Program with RestoreTerminal.
func (p *Program) ReleaseTerminal() error {
p.ignoreSignals = true
p.cancelInput()
p.cancelReader.Cancel()
p.waitForReadLoop()
p.altScreenWasActive = p.renderer.altScreen()