Open muzimuzhi opened 1 week ago
Here are a few points.
git log
works this way by default so I'm not sure about your comment about git (see man git-config
).We could perhaps carry on the value of the LESS
variable if the user defined it (like git
does). That would allow you to use the LESS
value you'd want. But I'm a bit vary and not very enthusiastic of changing things in this area. The whole groff and paging business is extremely fragile and I can already see more people coming here complaining that their help is garbled because they have a LESS
variable set without the R
.
I just realized PAGER=less LESS=-R
is set by oh-my-zsh
by default, which I haven't thought about why and already taken as granted.
The whole groff and paging business is extremely fragile and I can already see more people coming here complaining that their help is garbled because they have a
LESS
variable set without theR
.
Understandable. Maintaining backwards compatibility is hard.
BTW what's inconvenient for me is that, in the file opened by less
, it's possible to scroll lines using mouse wheel, but not if it's opened by less -X
, in both macOS terminal.app
and iTerm2. Maybe this is configurable in these terminal emulators.
As a macOS user new to OCaml, I find after I quit
opam --help
ordune --help
, the help content is kept in the terminal. This default behavior is different from (most?) other CLI programs likegit
orman
.Is there a way to overwrite this behavior?
I have environment variables
It seems this is caused by the use of
less
option-X/--no-init
, added in 1de361182abcb809bbc9856238b958b12039efd7 and f239981642aefc2792382a1417c690bb6eaeb264 for #167.https://github.com/dbuenzli/cmdliner/blob/cb235b559e29a063fe3c4fb1a60b444cf70dd402/src/cmdliner_manpage.ml#L466-L472