After an update I noticed that my bash profile for
man colorization breaks paging. I don't know what changed but I narrowed it down to the fact that calling
env less hello.txt results in contents of
hello.txt being echoed to the terminal (like
cat) without the paging behavior. How do I debug and fix this?
To eliminate the effect of some environment variables, I tested with the minimal environment:
env -i TERM=xterm-256color /usr/bin/less hello.txt
env -i /usr/bin/less hello.txt
This also simply prints the file to stdout. On a different machine with the same software versions, the paging works (if
TERM is preserved).
env -i behaves differently, I don't suppose that the reason is something in my environment.
env are the same:
less 581.2 (PCRE2 regular expressions) and
GNU coreutils 8.32, OS is Arch Linux 64 bit, up to date, shell:
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu).