From:             addw at phcomp dot co dot uk
Operating system: Linux/Unix
PHP version:      5.5.4
Package:          CGI/CLI related
Bug Type:         Bug
Bug description:PHP cli forces the tty to cooked mode

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 bug report at https://bugs.php.net/bug.php?id=65714&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65714&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65714&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65714&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65714&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65714&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65714&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65714&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65714&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65714&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65714&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65714&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65714&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65714&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65714&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65714&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65714&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65714&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65714&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65714&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65714&r=mysqlcfg

Reply via email to