Skip to content

Commit

Permalink
fix: restore Windows console mode on shutdown
Browse files Browse the repository at this point in the history
The deferred Close call on our input reader caused the console mode
to be reset twice, and the incorrect, inner mode was applied last.
  • Loading branch information
muesli committed Oct 20, 2022
1 parent a7067fb commit 9bcfc02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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()
Expand Down

0 comments on commit 9bcfc02

Please sign in to comment.