Yes, for _microcom_ 2043855a4bd5 is sufficient for my use cases.

However I think _stty_ should also use TCSADRAIN/TCSANOW to not discard
data. _stty_ flushing and discarding data is surprising to me, because none
of the other stty implementations do this AFAIK (coreutils, freebsd ...).
The https://pubs.opengroup.org/onlinepubs/9699919799/utilities/stty.html
says `stty` should "set of report" termios, it doesn't specify "how" the
termios should be set, nor does it say pending data should/shouldn't be
flushed.

On Fri, May 31, 2024 at 11:08 PM Rob Landley <r...@landley.net> wrote:

> On 5/20/24 23:43, Yi-Yo Chiang via Toybox wrote:
> > Don't flush the tty device input queue when setting device attribute.
> >
> > Rationale:
> >   * microcom: The tty device might already have a _good enough_ termios
> >     to read data from. Flushing the input queue just to set the terminal
> >     attribute would result in data loss in this case.
> >   * stty: This command doesn't read nor write data to the tty device, so
> >     flushing the input queue doesn't make sense here. The program
> >     actually talking to the tty should decide if it wants the tty
> >     flushed or not.
> >     Note: other implementations of stty also uses TCSANOW (bsd) or
> >     TCSADRAIN (coreutils), so I think this assumption is fine.
>
> Was commit 2043855a4bd5 sufficient or do you still have a use case that
> needs
> this? (Email dated the 20th containing a patch dated the 21st vs a git
> commit
> applied the 23rd...)
>
> Rob
>
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to