clue/reactphp-stdio

Support Microsoft Windows

clue opened this issue · 3 comments

clue commented
Support Microsoft Windows
clue commented

See also #26, as MS Windows doesn't use UTF-8 by default.

clue commented

There does not appear to be a sane way to read individual key presses on MS Windows, see also #16.

In particular, the loop will be blocked once the user hits any key on the keyboard.

https://bugs.php.net/bug.php?id=34972

clue commented

Note that Microsoft Windows is not supported.
Due to platform inconsistencies, PHP does not provide support for reading from
standard console input without blocking.
Unfortunately, until the underlying PHP feature request is implemented (which
is unlikely to happen any time soon), there's little we can do in this library.
A work-around for this remains unknown.
Your only option would be to entirely
disable interactive input for Microsoft Windows.
However this package does work on Windows Subsystem for Linux
(or WSL) without issues. We suggest installing WSL
when you want to run this package on Windows.

There's hope that https://bugs.php.net/bug.php?id=34972 will be implemented eventually. Until this happens, there's little we can do here.

This library will (have to) throw an Exception on Microsoft Windows in a future version. This is required in order to update our dependencies (#50) and eventually include reactphp/stream#46.

Relevant documentation to the README has been added via #54, so this ticket has been closed.

If anybody happens to find a work-around, please report back to this ticket and I'm happy to reopen 👍