diff --git a/cmd/globals.go b/cmd/globals.go index 9344df8f17..4c355bdb55 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -22,7 +22,6 @@ import ( "context" "crypto/x509" "net/url" - "os" "time" "github.com/charmbracelet/lipgloss" @@ -86,26 +85,14 @@ var ( // Terminal height/width, zero if not found globalTermWidth, globalTermHeight int - globalDisablePagerFlag = "--disable-pager" - globalPagerDisabled = false - globalHelpPager *termPager - globalPagerEnabledTerms = map[string]bool{ - "screen-256color": true, - "xterm": true, - "xterm-256color": true, - "tmux": true, - "tmux-256color": true, - } + globalDisablePagerFlag = "--disable-pager" + globalPagerDisabled = false + globalHelpPager *termPager // CA root certificates, a nil value means system certs pool will be used globalRootCAs *x509.CertPool ) -func terminalSupportsPager() (ok bool) { - _, ok = globalPagerEnabledTerms[os.Getenv("TERM")] - return -} - func parsePagerDisableFlag(args []string) { for _, arg := range args { if arg == globalDisablePagerFlag { diff --git a/cmd/main.go b/cmd/main.go index c7017709ad..36c111d24c 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -512,7 +512,7 @@ func registerApp(name string) *cli.App { app.EnableBashCompletion = true app.OnUsageError = onUsageError - if isTerminal() && terminalSupportsPager() && !globalPagerDisabled { + if isTerminal() && !globalPagerDisabled { app.HelpWriter = globalHelpPager } else { app.HelpWriter = os.Stdout