Subject: bug#57727: 29.0.50; Optimize tty display updates

From: Gerd Möllmann <[email-masked]>
Date: Mon, 12 Sep 2022 15:15:06 +0200

Gerd Möllmann <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>> FWIW, I don't think this is over-engineered.  The suspend/resume dance
>> caused me to raise a brow, but I guess you cannot otherwise reset the
>> terminal settings?
>
> I'll check if can find a way to not suspend/resume.  In principle, it
> should be possible to fflush/fclose/fopen/setvbuf, but I have to check
> if that is sufficient.  Suspend/resume looked a cheap hack to get what I
> wanted.

I'm afraid that doesn't work well.

The problem is that a setvbuf with a new buffer size requires an fclose,
by the C standard.  The fclose closes the file handle used with fdopen,
so we have to go through all what suspend/resume already do.

Too bad.