[Toybox] [PATCH] ps, vi: fix flicker.
enh
enh at google.com
Fri Feb 24 12:35:55 PST 2023
On Fri, Feb 24, 2023 at 12:28 PM Jarno Mäkipää <jmakip87 at gmail.com> wrote:
>
> 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?
yes, you're right. that or setbuffer().
new patch attached.
> >
> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ps-vi-fix-flicker.patch
Type: application/octet-stream
Size: 2406 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230224/ce5fa886/attachment.obj>
More information about the Toybox
mailing list