On 08/11/2025 11:32, Страхиња Радић wrote:
Дана 25/11/07 11:32PM, Jon Tibble написа:
I've been having issues with less -F not working in xterm.  The command
just returns without displaying anything.  This can be worked around by
adding -X to not initialise the terminal.  This works fine, without -X,
in the console.

OpenBSD equivalent of

        less -FR

is

        less -FRcX

You can set those in LESS environment variable, or (for git)

        core.pager=/usr/bin/less -FRcX

in .gitconfig. Works For Me™.


Thanks for the response.  Unfortunately they are not quite equivalent
due to -F behaviour with the upstream patches on other OSs.  This may
be considered a side-effect rather than the goal of -F itself with the
primary goal of exiting being consistent across OSs so, to be clear, I
do not consider this a bug.

So, with the side-effect, there are three less behaviours here:

1 - All is paged and on the alt screen where available so does not
    appear in the terminal scrollback upon exit.  This seems to be the
    general default across OSs with no flags.

2 - All is not paged and is dumped into the scrollback.  This is the
    general behaviour in OS consoles and when using -X in terminals
    where the alt screen is available.

3 - A hybrid mode, for terminals that have alt screens, where content
    that fits in a single screen is not paged and appears in the
    scrollback and longer content is paged and will not appear in the
    scrollback.  This is the behaviour with -F on other OSs.

So the behaviour that is being addressed in the patch is 3 which is
currently missing in the OpenBSD less.
Going the other way, the equivalent of your OpenBSD command on other
OSs would be

  less -FRX

because the -X makes everything dump to scrollback yielding behaviour
2 instead of 3.

Best Regards,
Jon

Reply via email to