fix(installer): always use `more` pager on Windows

This commit is contained in:
Christopher Allen Lane 2022-08-08 20:37:27 -04:00
parent 6421953183
commit 2a6586b41b
1 changed files with 6 additions and 0 deletions

View File

@ -3,11 +3,17 @@ package config
import (
"os"
"os/exec"
"runtime"
)
// Pager attempts to locate a pager that's appropriate for the environment.
func Pager() string {
// default to `more` on Windows
if runtime.GOOS == "windows" {
return "more"
}
// if $PAGER is set, return the corresponding pager
if os.Getenv("PAGER") != "" {
return os.Getenv("PAGER")