Disable pager when set to "cat"

This commit is contained in:
Teubel György 2020-09-29 17:15:12 +02:00
parent e24035681d
commit 9b2fe1ee30
3 changed files with 3 additions and 3 deletions

View file

@ -181,7 +181,7 @@ func NewBlankRoot() *yaml.Node {
Value: PromptsEnabled,
},
{
HeadComment: "A pager program to send command output to. Example value: less",
HeadComment: "A pager program to send command output to, e.g. \"less\". Set the value to \"cat\" to disable the pager.",
Kind: yaml.ScalarNode,
Value: "pager",
},

View file

@ -45,7 +45,7 @@ func Test_defaultConfig(t *testing.T) {
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to. Example value: less
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:

View file

@ -138,7 +138,7 @@ func (s *IOStreams) SetPager(cmd string) {
}
func (s *IOStreams) StartPager() error {
if s.pagerCommand == "" || !s.IsStdoutTTY() {
if s.pagerCommand == "" || s.pagerCommand == "cat" || !s.IsStdoutTTY() {
return nil
}