[Toybox] [PATCH] microcom, stty: Use TCSADRAIN to set tty device attribute

2024-05-20 Thread Yi-Yo Chiang via Toybox
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

Re: [Toybox] microcom.c discarding data due to TCSAFLUSH

2024-05-20 Thread enh via Toybox
On Mon, May 20, 2024 at 10:43 AM Yi-Yo Chiang wrote: > > Found this out today when comparing captured logs. Every time I connect to a > pty the first few hundreds of bytes seem to always be missing. > I then traced to this line >

[Toybox] microcom.c discarding data due to TCSAFLUSH

2024-05-20 Thread Yi-Yo Chiang via Toybox
Found this out today when comparing captured logs. Every time I connect to a pty the first few hundreds of bytes seem to always be missing. I then traced to this line https://github.com/landley/toybox/blob/master/toys/net/microcom.c#L103 and it's the tcsetattr(TCSAFLUSH) that is discarding

[Toybox] [PATCH] microcom: Don't crash if failed to open paste file

2024-05-20 Thread Yi-Yo Chiang via Toybox
* When running the "paste" command and failed to open the paste file (such as file not found or permission error), don't crash the entire microcom program. Instead print the error message and give the user a chance to fix the problem. * If "paste" command is cancelled by "ESC" or an empty

Re: [Toybox] [PATCH] xputs: Do flush

2024-05-20 Thread Yi-Yo Chiang via Toybox
Thanks! Adding TOYFLAG_NOBUF worked. I feel the same way about "manual flushing of the output buffer is a terrible interface". I asked myself the question "Why am I manually flushing so much? There must be a better way..." multiple times when I wrote the other patch that does s/xprintf/dprintf/,

Re: [Toybox] [PATCH] xputs: Do flush

2024-05-20 Thread enh via Toybox
On Sun, May 19, 2024 at 10:56 PM Rob Landley wrote: > > On 5/18/24 21:53, Yi-Yo Chiang wrote: > > What I wanted to address with this patch are: > > > > 1. Fix this line of > > xputs() > > https://github.com/landley/toybox/blob/master/toys/net/microcom.c#L113 > > The prompt text is not flushed

[Toybox] [PATCH] netcat: clarify documentation.

2024-05-20 Thread enh via Toybox
"Collate" means "sort", but -O is like -o other than buffering. --- toys/net/netcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 0001-netcat-clarify-documentation.patch Description: Binary data ___ Toybox mailing list