Bug #74490 [NEW]: readline() moves the cursor to the beginning of the line
| From: | webmaster_20170422 at cubiclesoft dot com | Date: | Sat, 22 Apr 2017 16:26:55 +0000 |
| Subject: | Bug #74490 [NEW]: readline() moves the cursor to the beginning of the line | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208716@lists.php.net to get a copy of this message | ||
From: webmaster_20170422 at cubiclesoft dot com
Operating system: Windows
PHP version: 7.1.4
Package: Readline related
Bug Type: Bug
Bug description:readline() moves the cursor to the beginning of the line
Description:
------------
As of PHP 7.1, the readline extension is compiled into PHP for Windows.
Unfortunately, calling readline() results in the keyboard caret moving
to the beginning of the line and clears any output on the line when the
first key is pressed on the keyboard. For example, running the test
script on Ubuntu Linux via a SSH terminal session (PHP run from Bash)
works as expected (the caret is not moved nor the start of the line
changed).
This behavior is most likely a bug in the upstream WinEditLine library.
Documenting it here in bugs.php.net so the author of that library and
the larger PHP community are aware of the issue.
This bug may be related to PHP Bug #74489, which describes a similar
problem with WinEditLine's readline() most likely not accepting a null
value for the prompt parameter.
Keyboard caret positioning information is available via the Windows
Console API GetConsoleScreenBufferInfo().
Test script:
---------------
<?php
echo "Name: ";
readline("");
?>
Expected result:
----------------
Similar behavior to *NIXes. The "Name: " string output to the terminal
via echo and the keyboard caret correctly appears at the end of the
string.
Actual result:
--------------
The "Name: " string appears but the keyboard caret is placed at the
start of the line. The first keypress results in the displayed text
being removed.
--
Edit bug report at https://bugs.php.net/bug.php?id=74490&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74490&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74490&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74490&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74490&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74490&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74490&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74490&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74490&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74490&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74490&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74490&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74490&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74490&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74490&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74490&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74490&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74490&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74490&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74490&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74490&r=mysqlcfg