[Toybox] [PATCH] more.c: More stuff, down cursor key scrolls down. Also stuff about less
Oliver Webb
aquahobbyist at proton.me
Thu Mar 21 14:13:21 PDT 2024
On Thursday, March 21st, 2024 at 15:53, Rob Landley <rob at landley.net> wrote:
> I note that "more" is from the days of daisy wheel teletypes, and was thus
> designed to work ok without a tty or interaction through cursor keys (you can
> export $COLUMNS and $LINES or just let it guess 80x25), and "less" requires a
> tty and cursor keys. This might make "more" a better fit for on-screen keyboards
> that don't provide cursor keys. (Or not...)
less supports vi keys (hjkl), and all the keybindings of more. less doesn't require
cursor keys in the same way vi doesn't, it's just how it's more commonly used.
> I would like to have one implementation sharing code. Implementing "less -R"
> cuts the behavior delta between the two, and having an option to let ctrl-c exit
> less (instead of just killing the rest of the pipeline) probably gets us close
> enough we to handwave the rest?
There is less -K and less -E (exit on C-c and exit at EOF respectively),
so more_main would look something like:
void more_main(void)
{
toys.optflags |= FLAG_E|FLAG_K|FLAG_R;
less_main();
}
Once we have a good enough less.
- Oliver Webb <aquahobbyist at proton.me>
More information about the Toybox
mailing list