allow graceful fallback when we don't have an alternate screen

This commit is contained in:
Justin Overfelt 2019-05-07 16:12:16 -04:00
parent ee0f2e3e9b
commit 509e5d81a1
1 changed files with 5 additions and 4 deletions

View File

@ -163,8 +163,9 @@ func HandleAlternateScreen(opt string) {
cmd := exec.Command("tput", opt) cmd := exec.Command("tput", opt)
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
err := cmd.Run() // explicitly ignoring the error here as
if err != nil { // the alternate screen is an optional feature
panic(err) // that may not be available everywhere we expect
} // to run
_ = cmd.Run()
} }