Bug #65714 [Asn->Csd]: PHP cli forces the tty to cooked mode
| From: | remi@php.net | Date: | Fri, 15 Nov 2013 08:53:34 +0000 |
| Subject: | Bug #65714 [Asn->Csd]: PHP cli forces the tty to cooked mode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182768@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65714&edit=1
ID: 65714
Updated by: remi@php.net
Reported by: addw at phcomp dot co dot uk
Summary: PHP cli forces the tty to cooked mode
-Status: Assigned
+Status: Closed
Type: Bug
Package: CGI/CLI related
Operating System: Linux/Unix
PHP Version: 5.5.4
Assigned To: remi
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b8d88bf2c588dcaec185468da8db306cd7e6ab8d
Log: Fix Bug #65714 PHP cli forces the tty to cooked mode
Previous Comments:
------------------------------------------------------------------------
[2013-11-15 08:43:34] remi@php.net
A simple solution is to not call using_history() which seems not required with libedit (haven't
test with readline).
Without this call, readline_* functions still work as expected.
A explicit call to readline_read_history still required to keep history across runs.
------------------------------------------------------------------------
[2013-09-19 15:34:33] addw at phcomp dot co dot uk
Description:
------------
I am running a PHP script at the command line and piping the output through less:
./myScript | less
Since less is an interactive program it puts the terminal into 'raw' mode so
that it can read characters one at a time. However, when I do the above I find
that the commands that I type to less are echoed back to me and not acted on
until I type <RETURN>. This is not as it should be.
The sript is not doing anything clever, just generating 100 lines:
for($i = 0; $i < 100; $i++)
echo "i=$i\n";
This has been discussed on the Internals mail list, the thread starts here:
http://marc.info/?l=php-internals&m=137915919531612&w=2
Test script:
---------------
I suggest a solution here:
http://marc.info/?l=php-internals&m=137951748702534&w=2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65714&edit=1