Re: php interactive shell: save history on SIGINT exit
| From: | Dmitry Saprykin | Date: | Mon, 21 Jul 2014 14:17:18 +0000 |
| Subject: | Re: php interactive shell: save history on SIGINT exit | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75799@lists.php.net to get a copy of this message | ||
changed "write_history" at the end to "append_history" after
each cli_is_valid_code.
Now it is -1 line, +1 line commit and completely looks like bug fix. )
On 21 July 2014 18:00, Johannes Schlüter <johannes@schlueters.de> wrote:
> On Mon, 2014-07-21 at 13:12 +0400, Dmitry Saprykin wrote:
> > Php interactive shell saves commands history when you exit it using
> 'quit'.
> > But it throws all you history away when you exit using Ctrl+C. It is
> common
> > practice to save history on SIGINT exit (mysql, mongo, etc.)
> >
> > I would like to implement SIGINT handler for interactive shell to save
> > history on Ctrl+C exit.
> >
> > Threre is request on bugs.php.net for this feature
> > https://bugs.php.net/bug.php?id=67496.
> > I have created pull request
> > https://github.com/php/php-src/pull/727 but
> > was advised to create RFC to discuss this change.
> >
> > So could you provide some feedback.
>
> I think messing with signals is not good - a script might try to catch
> them, too. What we can do is to save the file each time we execute
> something. (between the is valid code chack and zend_eval)
>
> johannes
>
>
>