You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/clue/stdio-react)
5
5
6
6
Async, event-driven and UTF-8 aware console input & output (STDIN, STDOUT) for
7
-
truly interactive CLI applications, built on top of [ReactPHP](https://reactphp.org).
7
+
truly interactive CLI applications, built on top of [ReactPHP](https://reactphp.org/).
8
8
9
9
You can use this library to build truly interactive and responsive command
10
10
line (CLI) applications, that immediately react when the user types in
@@ -18,18 +18,18 @@ without requiring any extensions or special installation.
18
18
*[Support us](#support-us)
19
19
*[Quickstart example](#quickstart-example)
20
20
*[Usage](#usage)
21
-
*[Stdio](#stdio)
22
-
*[Output](#output)
23
-
*[Input](#input)
24
-
*[Prompt](#prompt)
25
-
*[Echo](#echo)
26
-
*[Input buffer](#input-buffer)
27
-
*[Cursor](#cursor)
28
-
*[History](#history)
29
-
*[Autocomplete](#autocomplete)
30
-
*[Keys](#keys)
31
-
*[Bell](#bell)
32
-
*[Readline](#readline)
21
+
*[Stdio](#stdio)
22
+
* [Output](#output)
23
+
* [Input](#input)
24
+
* [Prompt](#prompt)
25
+
* [Echo](#echo)
26
+
* [Input buffer](#input-buffer)
27
+
* [Cursor](#cursor)
28
+
* [History](#history)
29
+
* [Autocomplete](#autocomplete)
30
+
* [Keys](#keys)
31
+
* [Bell](#bell)
32
+
*[~~Readline~~](#readline)
33
33
*[Pitfalls](#pitfalls)
34
34
*[Install](#install)
35
35
*[Tests](#tests)
@@ -570,7 +570,9 @@ enable or disable emitting the BELL signal when using a disabled function:
570
570
$stdio->setBell(false);
571
571
```
572
572
573
-
### Readline
573
+
### ~~Readline~~
574
+
575
+
> Deprecated since v2.3.0, see [`Stdio`](#stdio) instead.
574
576
575
577
The deprecated `Readline` class is responsible for reacting to user input and
576
578
presenting a prompt to the user. It does so by reading individual bytes from the
@@ -633,7 +635,7 @@ ob_start(function ($chunk) use ($stdio) {
633
635
634
636
## Install
635
637
636
-
The recommended way to install this library is [through Composer](https://getcomposer.org).
638
+
The recommended way to install this library is [through Composer](https://getcomposer.org/).
637
639
[New to Composer?](https://getcomposer.org/doc/00-intro.md)
638
640
639
641
This project follows [SemVer](https://semver.org/).
@@ -648,7 +650,7 @@ See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
648
650
This project aims to run on any platform and thus does not require any PHP
649
651
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
650
652
HHVM.
651
-
It's *highly recommended to use PHP 7+* for this project.
653
+
It's *highly recommended to use the latest supported PHP version* for this project.
652
654
653
655
Internally, it will use the `ext-mbstring` to count and measure string sizes.
654
656
If this extension is missing, then this library will use a slighty slower Regex
@@ -663,22 +665,19 @@ Input line editing is handled entirely within this library and does not rely on
663
665
Installing `ext-readline` is entirely optional.
664
666
665
667
Note that *Microsoft Windows is not supported*.
666
-
Due to platform inconsistencies, PHP does not provide support for reading from
667
-
standard console input without blocking.
668
+
Due to platform constraints, PHP does not provide support for reading from
669
+
standard console input without blocking on Windows.
668
670
Unfortunately, until the underlying PHP feature request is implemented (which
669
671
is unlikely to happen any time soon), there's little we can do in this library.
670
-
A work-around for this remains unknown.
671
-
Your only option would be to entirely
672
-
[disable interactive input for Microsoft Windows](https://github.com/clue/psocksd/commit/c2f2f90ffc8ebf8233839ba2f3553f2698930125).
673
-
However this package does work on [`Windows Subsystem for Linux`](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
674
-
(or WSL) without issues. We suggest [installing WSL](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
672
+
However, this package does work on Windows Subsystem for Linux (or WSL) without
673
+
issues. We suggest [installing WSL](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
675
674
when you want to run this package on Windows.
676
675
See also [#18](https://github.com/clue/reactphp-stdio/issues/18) for more details.
677
676
678
677
## Tests
679
678
680
679
To run the test suite, you first need to clone this repo and then install all
0 commit comments