[Toybox] [PATCH] ps, vi: fix flicker.

Jarno Mäkipää jmakip87 at gmail.com
Fri Feb 24 12:28:06 PST 2023


On Thu, Feb 23, 2023 at 10:42 PM enh via Toybox
<toybox at lists.landley.net> wrote:
>
> My earlier trick to ensure that we buffer whole screens full works fine
> on glibc, but both bionic and musl have a tiny 1024-byte BUFSIZ that
> makes it unsuitable for this kind of use, even on laptop screens.
>
> Explicitly say 8192, since 4096 is slightly too small for my larger
> laptop's screen (and I don't use a particularly small font).

Should setvbuf be used instead of setbuf if passing buffer size other
than BUFSIZ?

>
> At some point we should probably move this into tty.c, dynamically
> allocate based on screen size (plus space for escape sequences/non-ASCII
> characters), and track SIGWINCH in case the window grows. But this stops
> top and vi flickering today, which is good enough for now. (Amusingly, I
> hit the vi problem -- which is actually much worse, for dense strace
> output -- while debugging the top problem, while debugging the ps
> problem, while debugging the thing I was actually supposed to be doing
> _yesterday_. So definitely time to back out of a few rat holes!)
> ---
>  toys/pending/vi.c | 2 +-
>  toys/posix/ps.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net

-Jarno


More information about the Toybox mailing list