<i>gets stdin problem when non-blocking - Windows</i> status still Open with 3 other changes
by
.
D 2024-02-20T06:19:40.176
J icomment There\swere\stwo\sissues.\sRecording\sfor\sposterity.\r\n\r\nFirst,\sPeekConsoleInput\swas\sbeing\sused\sto\scheck\sif\sthere\sis\sinput.\sIt\sturns\sout\sthis\sWin32\sAPI\sonly\schecks\sthe\sconsole\sinput\srecords\sthat\shave\snot\syet\sbeen\sconverted\sto\stext.\sSo\sfor\sexample\sin\sthe\sbug\sreport,\sif\sthe\sentered\sline\swas\s110\scharacters,\sthe\sReadConsole\swith\sa\sbuffer\ssize\sof\s200\s(100\scharacters)\swould\sreturn\s100\scharacters\sand\sstore\sthe\sremaining\s10\sinternally\sfor\sthe\snext\sread.\sThe\sconsole's\sinput\srecord\squeue\swould\sbe\sempty\sso\swhen\sthe\sTcl\sconsole\sdriver\scalled\sPeekConsoleInput,\sit\swould\sreport\sno\sinput\spending.\sEntering\sanother\scharacter\swould\screate\sa\sinput\srecord,\sthereby\shaving\sthe\sPeek\sindicate\sinput\sand\striggering\sa\sread.\sTo\sfix\sthis,\sthe\sTcl\sconsole\sread\sthread\swill\snow\simmediately\strigger\sanother\sread\sif\sthe\sprevious\sread\scompletely\sfilled\sthe\spassed\sbuffer.\sTested\swith\smanually\sreducing\sread\sbuffer\ssize\sdown\sto\s20\sbytes\s(since\sthe\sfix\sbelow\srequires\sincreasing\sbuffer\ssize\sfor\sa\sdifferent\sreason).\r\n\r\nThe\ssecond\sissue,\snot\sreported\sabove\sbut\smentioned\son\sthe\schat\sis\sthe\slimit\sof\s254\scharacters\son\sinput\slines.\sIt\sseems\sReadConsole\swill\slimit\sline\slengths\sto\sthe\smax\sof\s256\s(including\scrlf)\sand\sthe\ssupplied\sbuffer\ssize\s(easily\schecked\svia\sa\ssimple\sconsole\sprogram).\sThere\sdoes\snot\sseem\sany\sway\saround\sthis\sso\snow\sthe\sbuffer\ssize\shas\sbeen\sbumped\sback\sto\s8192\sas\sin\s8.6.\sNote\sthis\sis\sa\ssingle\sallocation\s*per\sprocess*\sin\s9.0\sas\sopposed\sto\s*per\sthread*\sin\s8.6,\sso\simpact\sshould\sbe\sminimal.
J login apnadkarni
J mimetype text/x-markdown
K bda99f23936f7170e8f51e7e3eb52db794a3195c
U apnadkarni
Z 3adff844c17e96cef8c550eabc6cf2f0