Skip to content

Commit

Permalink
chore(exec): disambiguate methods for restoring the terminal state vs…
Browse files Browse the repository at this point in the history
… input
  • Loading branch information
meowgorithm committed Apr 7, 2022
1 parent 8e380dc commit f5ff931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tea.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tty.go
Expand Up @@ -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 {
Expand Down

0 comments on commit f5ff931

Please sign in to comment.