mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: restore Windows console mode on shutdown
The deferred Close call on our input reader caused the console mode to be reset twice, and the incorrect, inner mode was applied last.
This commit is contained in:
2
tea.go
2
tea.go
@@ -442,7 +442,6 @@ func (p *Program) Run() (Model, error) {
|
||||
if err := p.initCancelReader(); err != nil {
|
||||
return model, err
|
||||
}
|
||||
defer p.cancelReader.Close() //nolint:errcheck
|
||||
}
|
||||
|
||||
// Handle resize events.
|
||||
@@ -468,6 +467,7 @@ func (p *Program) Run() (Model, error) {
|
||||
if p.cancelReader.Cancel() {
|
||||
p.waitForReadLoop()
|
||||
}
|
||||
_ = p.cancelReader.Close()
|
||||
|
||||
// Wait for all handlers to finish.
|
||||
handlers.shutdown()
|
||||
|
||||
Reference in New Issue
Block a user