Overview
| Artifact ID: | da01051522864533c8b6f44e28fec566054b06d56085b61b63ad8c4353391141 |
|---|---|
| Ticket: | 1d0618000674abdf701021d69eaa858cbccf14a4
channel reads prematurely from stdin on Windows |
| User & Date: | apnadkarni on 2025-11-08 07:16:54 |
Changes
- icomment:
I suspect this is unavoidable behavior (on Windows where stdin is the console). The issue, as I remember it, is that the Windows console API does not support non-blocking or async i/o so it is simulated with blocking i/o on another thread which in turn requires a read of at least one byte. Further detail would require me to source dive to recall all the issues. In the general case, I'm not sure what the "official" stance, if any, is on mixing i/o between Tcl channels and C RTL or system calls. Even aside from Windows consoles, I think the channel subsystem will also do read ahead in certain cases like looking for the CRLF->LF translation or completion of a UTF-8 multibyte sequence. That is conjecture on my part and someone who fully understands the channel subsystem in Tcl (probably only one or two such in the universe :-)) can answer definitively.
- login: "apnadkarni"
- mimetype: "text/x-markdown"