slavapestov/factor — Issue #296: Investigate preventing ^C from causing eof on stdio streams on Windows
Author: jckarter
Created: 2011-10-27 05:07:06+00:00
State: open
Labels: windows

On Windows, even with a CtrlHandler installed, hitting ^C during `fgetc` will return exactly as if it had reached end of file: `EOF` is returned, `feof(stdin)` is true, `ferror(stdin)` is false, and `errno` is zero. If you hit ^C at the listener prompt, the FEP comes up while the listener tries to exit, when ideally the listener should continue. Since the CtrlHandler runs in a separately spawned thread, we can't reliably set a flag that will be seen before `fgetc` returns to mark the EOF as being sourced from ^C. Hopefully there's a workaround somewhere.