php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67496 Save command history when exiting interactive shell with control-c
Submitted: 2014-06-23 02:08 UTC Modified: 2017-03-31 17:42 UTC
Votes:2
Avg. Score:3.5 ± 1.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: ryan dot brothers at gmail dot com Assigned: x (profile)
Status: Closed Package: *General Issues
PHP Version: 5.5.13 OS: Linux
Private report: No CVE-ID: None
 [2014-06-23 02:08 UTC] ryan dot brothers at gmail dot com
Description:
------------
When using the PHP interactive shell (php -a), pressing Control-C to exit the shell does not write your last commands to ~/.php_history.  Both the mysql and mongo console clients save your command history when you press Control-C to exit.  Could the PHP interactive shell be updated to save your command history when Control-C is pressed to exit the shell?  I use Control-C to exit various console clients, and often lose my last run commands in the PHP interactive shell since they are not saved when Control-C is used to exit the shell.

Test script:
---------------
1) Run: php -a
2) Type: $a = 1;
3) Press: Control-C
4) Run: php -a
5) Press up.

Expected result:
----------------
php > $a = 1;

Actual result:
--------------
php > $b = 2;


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-24 16:03 UTC] johannes@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-07-24 16:03 UTC] johannes@php.net
-Status: Open +Status: Closed
 [2014-07-30 09:52 UTC] tyrael@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-08-04 08:26 UTC] ab@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-08-04 08:43 UTC] ab@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-08-04 09:59 UTC] dmitry@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-10-07 23:13 UTC] stas@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2014-10-07 23:24 UTC] stas@php.net
Automatic comment on behalf of saprykin.dmitry@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=d491b2f916d061666d9ff1cb5bdc484961b82db0
Log: Fix bug #67496 Save command history when exiting interactive shell with control-c
 [2017-03-31 17:40 UTC] bukka@php.net
Automatic comment from SVN on behalf of bukka
Revision: http://svn.php.net/viewvc/?view=revision&revision=342210
Log: Fix doc bug #67496 (json_encode changed behaviour in 5.5)
 [2017-03-31 17:41 UTC] bukka@php.net
-Assigned To: +Assigned To: bukka
 [2017-03-31 17:41 UTC] bukka@php.net
Sorry wrong number - the commit above is for something else...
 [2017-03-31 17:42 UTC] bukka@php.net
-Assigned To: bukka +Assigned To: x
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 07:01:29 2024 UTC