Edit report at https://bugs.php.net/bug.php?id=65191&edit=1
ID: 65191
Comment by: pippo at gmail dot com
Reported by: azhdanov at terricone dot com
Summary: "Delete", "ctrl"+ arrows don't work in interactive
interpreter
Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 5.4.16
Block user comment: N
Private report: N
New Comment:
@cataphract: Thanks, your tip - for DELETE key - run fine!
$ cat ~/.editrc
bind "\e[3~" ed-delete-next-char
Previous Comments:
------------------------------------------------------------------------
[2013-07-03 17:58:48] [email protected]
Not a PHP bug. Configure .editrc (for libedit) or .inputrc (for readline). For
instance, I see that ubuntu compiles PHP against libedit, so for instance to
have DEL to work you could edit your ~/.editrc and add:
bind "\e[3~" ed-delete-next-char
or just use default shortcuts here: http://www.bigsmoke.us/readline/shortcuts
Those are valid for both libedit and readline.
My guess is that irc, ipython etc. are compiled against readline and your
distros provide a global /etc/inputrc where the bindings are defined.
------------------------------------------------------------------------
[2013-07-03 08:33:02] azhdanov at terricone dot com
Description:
------------
When running PHP interactive interpreter with:
php -a
"Delete" button doesn't work (produces `~` instead), jumping over words with
"Ctrl"+"Left Arrow" and "Ctrl"+"Right Arrow" doesn't work either (`;5D` and
`;5C`, respectively). It annoys me a lot - I use `php -a` every day.
Worth noting, that other interpreters (irb, ipython, etc.) work good.
The problem occurs in each distro I tried - (K)Ubuntu (PHP 5.4.9-4ubuntu2.1
(cli)
(built: Jun 11 2013 13:10:01)), Fedora (PHP 5.3.3 (cli) (built: Nov 29 2012
04:12:23)), RHEL (PHP 5.3.3 (cli) (built: Nov 29 2012 04:12:23)). Works good on
Mac though.
Expected result:
----------------
Ctrl+arrows should move the cursor by words, delete should delete current
character.
Actual result:
--------------
Ctrl+left arrow produces ;5D
Ctrl+right arrow produces ;5C
Delete produces ~
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65191&edit=1