diff --git a/tea.go b/tea.go index 482f3cd7cd..dd744a49f8 100644 --- a/tea.go +++ b/tea.go @@ -628,7 +628,7 @@ func (p *Program) shutdown(kill bool) { p.ExitAltScreen() p.DisableMouseCellMotion() p.DisableMouseAllMotion() - _ = p.restoreTerminal() + _ = p.restoreTerminalState() } // EnterAltScreen enters the alternate screen buffer, which consumes the entire @@ -721,7 +721,7 @@ func (p *Program) ReleaseTerminal() error { p.ExitAltScreen() time.Sleep(time.Millisecond * 10) // give the terminal a moment to catch up } - return p.restoreTerminal() + return p.restoreTerminalState() } // RestoreTerminal reinitializes the Program's input reader, restores the diff --git a/tty.go b/tty.go index f7d0017b5e..17e508b971 100644 --- a/tty.go +++ b/tty.go @@ -24,7 +24,9 @@ func (p *Program) initTerminal() error { return nil } -func (p Program) restoreTerminal() error { +// restoreTerminalState restores the terminal to the state prior to running the +// Bubble Tea program. +func (p Program) restoreTerminalState() error { showCursor(p.output) if p.console != nil {