Re: Fwd: read -t 0 fails to detect input.

2019-12-19 Thread Martin Schulte
Hello! > Could you please comment about this assertions: > > 1.- bash will either do a select() or an ioctl(FIONREAD), or neither > of them, but not both, as it should for it to work. read -t0 is broken. > 2.- Conclusion: read -t0 is *broken* in bash. Don't use it. – No. It works as intended

Fwd: read -t 0 fails to detect input.

2019-12-19 Thread Bize Ma
To: Chester Ramey On thu., dec. 19 of 2019 at 12:40, Chet Ramey () wrote: > On 12/18/19 6:40 PM, Bize Ma wrote: > > >>> The exit status is 0 if input is available on the specified file > > descriptor, non-zero otherwise. > > Bash-5.0 uses select/FIONREAD to determine whether or not there is

Re: Crash when moving full-width glyphs across lines

2019-12-19 Thread Kirill Chibisov
I was able to capture the stack trace under gdb. However you should probably use the following command in it to repro the issue. `set disable-randomization off` The issue happens quite randomly, however the important thing is exit code from bash (139). So there's something with memory access, I g

Re: read -t 0 fails to detect input.

2019-12-19 Thread Chet Ramey
On 12/18/19 6:40 PM, Bize Ma wrote: It seems that read -t 0 should detect if there is input from a pipe (and others). From man bash: If timeout is 0, read returns immediately, without trying to read any data. The exit status is 0 if input is available on the specified file descriptor, n

unsetting non set items

2019-12-19 Thread 積丹尼 Dan Jacobson
Man bash: "unset" if there is no variable by that name, any function with that name is unset. Add: If there is no function by that name, nothing happens for that name.