Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e27caa54f9e5dde67abedaf28ae4e4274456572536b9118817713848ecbdd5f3
Ticket: 1d0618000674abdf701021d69eaa858cbccf14a4
channel reads prematurely from stdin on Windows
User & Date: apnadkarni on 2025-11-10 07:45:30
Changes

  1. icomment:
    Use of  `*WaitFor*` functions is something of a red herring. It is not a question of detecting availability of data, but rather not blocking on the `ReadConsole` either because the wait fired because of a non-character event (e.g. mouse) in which case `ReadConsole` would still block, or because some thread read the data in the meanwhile.
    
    Your comment implies you are using 8.6. I'm afraid any changes to the console code there are very unlikely to happen for a number of reasons.
    
    Are you willing to move to 9.0 (which has a complete console rewrite albeit with the same read ahead)? If so, I can attempt a fix though I am still skeptical of intermixing Tcl channels with raw read/fread calls.
    
    Also, thanks for your sample program. Can you also link me to the original code from which the sample is derived (assuming it is open source)?
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"