From:             david at acz dot org
Operating system: SuSE Linux 9.3
PHP version:      5.2.0
PHP Bug Type:     Readline related
Bug description:  Readline should re-read the window size

Description:
------------
The readline() function should re-read the window size every time it is
called.  The edit line and history get messed up if it doesn't get
SIGWINCH (for example, if the window was resized in a child process).

1) Start the test program with a typical 80x40 window.
2) At the first prompt, press up to see that the history displays
correctly.
3) Press enter to exit readline() and run less.
4) In less, maximize the terminal window, then quit less.
5) At the second prompt, press up and notice that the history is messed
up.


Reproduce code:
---------------
<?
    $s = "";
    for ($i = 65; $i <= 90; $i++)
        $s .= str_repeat(chr($i), 3) . " ";
    readline_add_history($s);

    readline("first> ");
    $p = popen("less", "w");
    fwrite($p, "maximize window");
    pclose($p);
    readline("second> ");
?>



-- 
Edit bug report at http://bugs.php.net/?id=40221&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40221&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40221&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40221&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40221&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40221&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40221&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40221&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40221&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40221&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40221&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40221&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40221&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40221&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40221&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40221&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40221&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40221&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40221&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40221&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40221&r=mysqlcfg

Reply via email to