forked from Mirrors/bubbletea
parent
b9bd01b79a
commit
8703897aad
3
tea.go
3
tea.go
|
@ -446,7 +446,6 @@ func (p *Program) Run() (Model, error) {
|
||||||
return model, err
|
return model, err
|
||||||
}
|
}
|
||||||
defer p.cancelReader.Close() //nolint:errcheck
|
defer p.cancelReader.Close() //nolint:errcheck
|
||||||
handlers.add(p.readLoopDone)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle resize events.
|
// Handle resize events.
|
||||||
|
@ -546,7 +545,7 @@ func (p *Program) shutdown(kill bool) {
|
||||||
// reader. You can return control to the Program with RestoreTerminal.
|
// reader. You can return control to the Program with RestoreTerminal.
|
||||||
func (p *Program) ReleaseTerminal() error {
|
func (p *Program) ReleaseTerminal() error {
|
||||||
p.ignoreSignals = true
|
p.ignoreSignals = true
|
||||||
p.cancelInput()
|
p.cancelReader.Cancel()
|
||||||
p.waitForReadLoop()
|
p.waitForReadLoop()
|
||||||
|
|
||||||
p.altScreenWasActive = p.renderer.altScreen()
|
p.altScreenWasActive = p.renderer.altScreen()
|
||||||
|
|
5
tty.go
5
tty.go
|
@ -79,11 +79,6 @@ func (p *Program) readLoop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cancelInput cancels the input reader.
|
|
||||||
func (p *Program) cancelInput() {
|
|
||||||
p.cancelReader.Cancel()
|
|
||||||
}
|
|
||||||
|
|
||||||
// waitForReadLoop waits for the cancelReader to finish its read loop.
|
// waitForReadLoop waits for the cancelReader to finish its read loop.
|
||||||
func (p *Program) waitForReadLoop() {
|
func (p *Program) waitForReadLoop() {
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in New Issue