<i>channel reads prematurely from stdin on Windows</i> status still Open with 3 other changes
by
.
D 2025-11-08T07:16:54.146
J icomment I\ssuspect\sthis\sis\sunavoidable\sbehavior\s(on\sWindows\swhere\sstdin\sis\sthe\sconsole).\sThe\sissue,\sas\sI\sremember\sit,\sis\sthat\sthe\sWindows\sconsole\sAPI\sdoes\snot\ssupport\snon-blocking\sor\sasync\si/o\sso\sit\sis\ssimulated\swith\sblocking\si/o\son\sanother\sthread\swhich\sin\sturn\srequires\sa\sread\sof\sat\sleast\sone\sbyte.\sFurther\sdetail\swould\srequire\sme\sto\ssource\sdive\sto\srecall\sall\sthe\sissues.\r\n\r\nIn\sthe\sgeneral\scase,\sI'm\snot\ssure\swhat\sthe\s"official"\sstance,\sif\sany,\sis\son\smixing\si/o\sbetween\sTcl\schannels\sand\sC\sRTL\sor\ssystem\scalls.\sEven\saside\sfrom\sWindows\sconsoles,\sI\sthink\sthe\schannel\ssubsystem\swill\salso\sdo\sread\sahead\sin\scertain\scases\slike\slooking\sfor\sthe\sCRLF->LF\stranslation\sor\scompletion\sof\sa\sUTF-8\smultibyte\ssequence.\sThat\sis\sconjecture\son\smy\spart\sand\ssomeone\swho\sfully\sunderstands\sthe\schannel\ssubsystem\sin\sTcl\s(probably\sonly\sone\sor\stwo\ssuch\sin\sthe\suniverse\s:-))\scan\sanswer\sdefinitively.
J login apnadkarni
J mimetype text/x-markdown
K 1d0618000674abdf701021d69eaa858cbccf14a4
U apnadkarni
Z f398fc11e0c52f1157d52b69547913a2