You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a macOS user new to OCaml, I find after I quit opam --help or dune --help, the help content is kept in the terminal. This default behavior is different from (most?) other CLI programs like git or man.
$ opam --help
OPAM(1) Opam Manual OPAM(1)
NAME
opam - source-based package management
SYNOPSIS
opam [COMMAND] …
...
$ git --paginate --help
$ man less
$
Is there a way to overwrite this behavior?
I have environment variables
$ echo $PAGER
less
$ echo $LESS
-R
It seems this is caused by the use of less option -X/--no-init, added in 1de3611 and f239981 for #167.
-X or --no-init
Disables sending the termcap initialization and deinitialization strings to the
terminal. This is sometimes desirable if the deinitialization string does something
unnecessary, like clearing the screen.
The text was updated successfully, but these errors were encountered:
This behaviour is more ergonomic than the alternative you suggest: you can get to the documentation of an option of interest, quit the pager and then try to use it while still having the documentation in sight.
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 the R.
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 1de3611 and f239981 for #167.cmdliner/src/cmdliner_manpage.ml
Lines 466 to 472 in cb235b5
The text was updated successfully, but these errors were encountered: