Is there a way to make pants use a pager via an en...
# general
p
Is there a way to make pants use a pager via an env var? I’m trying to record an asciinema of
./pants help goals
but it scrolls by too quickly.
f
./pants help goals | less
?
p
Yeah, but then that distracts from highlighting pants 😛
./pants help goals | more -r
I want to avoid piping it into the pager.
f
so you want something like what
git help
does when it invokes the pager automatically?
p
yeah
h
feel free to open a feature request 🙂
f
goal output is made using the
Console
type. The help goal could enable the
Console
type (or some related type) invoking
$PAGER
and then write the output into the pager subprocess
1
^^ very hand wavy sketch of a solution
p
Aargh. Passing the help through a pager (
less
or
more
) results in bad line breaks (esp noticable with
./pants help targets
. https://asciinema.org/a/519532
How does pants determine where to add line breaks?
w
by querying the TTY size… but i think that as soon as stdout is piped, it will no longer register as a TTY?
p
I guess so. The
COLUMNS
variable is correct - does the TTY logic use that? If not, maybe that would be a good fallback if not running under a tty.
💯 1
p
ooh! Then I could make my window 96 chars wide to avoid the odd output without waiting for any code changes in pants! Thanks for finding that.
👍 1