Skip to content

Commit

Permalink
Ensure alt screen switch always clears terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
knz committed Aug 25, 2022
1 parent 337c3e0 commit 262454d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ func cursorBack(w io.Writer, n int) {

func enterAltScreen(w io.Writer) {
fmt.Fprintf(w, te.CSI+te.AltScreenSeq)
moveCursor(w, 0, 0)
// Ensure that the terminal is cleared, even when it doesn't support
// alt screen (or alt screen support is disabled, like GNU screen by
// default).
clearScreen(w)
}

func exitAltScreen(w io.Writer) {
Expand Down

0 comments on commit 262454d

Please sign in to comment.