[php-src] Issue #7934: Unable to use ANSI escape code in readline() prompt on Windows
| From: | dktapps | Date: | Tue, 11 Jan 2022 21:24:03 +0000 |
| Subject: | [php-src] Issue #7934: Unable to use ANSI escape code in readline() prompt on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238976@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7934
Author: dktapps
### Description
The following code:
```php
$prompt = "\x1b[38;5;203m> \x1b[m";
echo $prompt;
var_dump(readline());
var_dump(readline($prompt));
```
Resulted in this output:
https://user-images.githubusercontent.com/14214667/149023343-3da5830f-b953-4cd7-a1f1-b1a7a769892f.png
But I expected this output instead:
https://user-images.githubusercontent.com/14214667/149023371-6ce10901-31c5-4136-aba0-12b343182b93.png
I have not tested this issue on Linux because I never encountered it there.
### PHP Version
8.0.13
### Operating System
Windows