1 (edited by rbro 2019-03-14 15:29:06)

Topic: readline and printing color text

I am running CentOS 7 with PHP 7.2.  Not sure if this is configuration, but when I compile php manually with --with-readline, I can run:

<?php
readline("\033[0;31maaa\033[0m");
?>

and it prints the text "aaa" in red.

When I do it with the PHP 7.2 RPM's, it prints:

[0;31maaa[0m

Comparing phpinfo(), my manual compile shows:

Readline Support => enabled
Readline library => 6.2

and the RPM shows:

Readline Support => enabled
Readline library => EditLine wrapper

Is there a way to use the RPM's and have the text print in color?

Thanks again for your help.

Ryan

Re: readline and printing color text

Indeed, this doesn't seems to be supported by libedit.


Notice: libreadline is licensed under GPL version 3 which is NOT compatible with PHP license, so nobody is allowed to build and distribute packages using this library.
libedit is (sadly) the only supported and compatible alternative

Sorry


P.S. FYI, there is a PR to totally drop libreadline support from PHP https://github.com/php/php-src/pull/3823

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test