Browse Source
Companion to punk::console 0.7.1 (three-site 8.6 console misdetection fix). The line-mode waiting-chunks path in repl_handler performed an unsized read that, entered via 'after idle' with the channel drained, made the tcl 8.6 windows console driver park a blocking cooked-mode ReadConsole (driver reads sample the console mode at issue time - a later raw flip cannot cancel one). After typed-ahead was stashed during a terminal-query raw window, that parked read swallowed every subsequent query response in the session until Enter, with the responses later leaking to the reader. On hostage-prone consoles (windows, no -inputmode configure key, real twapi console handle) the path now consumes only data already in the Tcl channel buffer (chan pending input + sized read - no driver probe). With nothing buffered it processes the stashed complete lines directly - preserving the recovered-typeahead execution order - and arms the readable handler for any remaining partial line, replacing an after-idle reinvoke that, without the read, could never have progressed; the parked read that arming creates is the reader legitimately waiting for the user to finish typing. Behaviour on tcl 9/8.7 (-inputmode consoles) and in raw mode is unchanged. Interactively verified on punksys (tcl 8.6.13, src launch): the previously failing case - typing a full command during a line-mode brokered query loop - now runs with all queries answering, the typed line executing after the loop, and no timeouts, response leakage or chan-blocked diagnostics; the session remains healthy afterwards. Full suite passes at baseline (exec-14.3 only) under Tcl 9.0.3. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.commaster
2 changed files with 48 additions and 4 deletions
Loading…
Reference in new issue