Closed dsully closed 5 months ago
One experiment would be to add --help
to the options in MOAR
and see what happens:
PAGER=moar MOAR=--help bat small-file
There are two possible outcomes:
moar
shows its help text. This means that moar
successfully gets the value of the MOAR
variable.small-file
is shown. This means that moar
does not get access to the MOAR
variable.1 would mean that moar
and -quit-if-one-screen
doesn't work properly for some reason. 2 could mean that bat
either doesn't launch moar
at all, or that it somehow / for some reason hides the MOAR
variable from moar
.
Just tested and the first outcome is what I see - the help output of moar
.
I was able to repro this locally.
Seems like -quit-if-one-screen
doesn't work for piped input, and it should.
Thanks for reporting, since I'm not using neither bat
nor -quit-if-one-screen
I would never have seen this. Will look into it.
Fix released: https://github.com/walles/moar/releases/tag/v1.22.3
Thanks for the quick fix!
When using
bat
with the following options:And running:
bat <small-file>
that should cause the-quit-if-one-screen
option to kick in, it doesn't and paging occurs.If I run
moar <small-file>
directly, then it works.If I run:
bat --pager="'$PAGER $MOAR'" <small-file>
it also works.TBH, I'm not sure if this is a
moar
issue or abat
issue or somewhere in between.