Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75795 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35973 invoked from network); 21 Jul 2014 14:01:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2014 14:01:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:49587] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/76-01457-84D1DC35 for ; Mon, 21 Jul 2014 10:01:44 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 62DA3415ED; Mon, 21 Jul 2014 16:01:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.31] (ppp-93-104-8-146.dynamic.mnet-online.de [93.104.8.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id AA0EE415EA; Mon, 21 Jul 2014 16:01:42 +0200 (CEST) To: Dmitry Saprykin Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Mon, 21 Jul 2014 16:00:55 +0200 Message-ID: <1405951255.3964.76.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] php interactive shell: save history on SIGINT exit From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) 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