Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75799 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42075 invoked from network); 21 Jul 2014 14:17:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2014 14:17:41 -0000 Authentication-Results: pb1.pair.com header.from=saprykin.dmitry@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=saprykin.dmitry@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.48 as permitted sender) X-PHP-List-Original-Sender: saprykin.dmitry@gmail.com X-Host-Fingerprint: 209.85.213.48 mail-yh0-f48.google.com Received: from [209.85.213.48] ([209.85.213.48:61584] helo=mail-yh0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/C7-01457-4012DC35 for ; Mon, 21 Jul 2014 10:17:41 -0400 Received: by mail-yh0-f48.google.com with SMTP id i57so4048136yha.35 for ; Mon, 21 Jul 2014 07:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=fU89mVSAlXvmq1lYJ0zixwrhdTHrc8tz8geWuLSS/kY=; b=b1K4PKZ+g63lNg4gw0tUoWbyryd4dIaQwE4m5OUjM4hZXcWDu9z6sSSzQEBJd+oaak mUttAmOUTEURqgqz2r1RaiKdY7sZOMfcxbTcCTgr2N4Fi4omsTiRWeNkyN577OOekBVT ir3jgjOJEkdW/yAs2bvDCetypAHtjLBh6ML8MxiV2/t056HH4VqgibHXJ757/nBCsSME Ld7YqeO+rUYhzoC4WzE9jbhY3BseVcBabKnf060zDI+qG8QvpIWQI0t9do7kY1om6HLx 9X0xVtgbp9epkmNreDwNlJRGtfsMtq/AWrCwFn4u3Nw9S+z2iCjSNHnzBSA4xeWG1O5x kFGg== X-Received: by 10.236.45.10 with SMTP id o10mr40036425yhb.49.1405952258113; Mon, 21 Jul 2014 07:17:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.191.67 with HTTP; Mon, 21 Jul 2014 07:17:18 -0700 (PDT) In-Reply-To: <1405951255.3964.76.camel@guybrush> References: <1405951255.3964.76.camel@guybrush> Date: Mon, 21 Jul 2014 18:17:18 +0400 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e011615fcea86ac04feb4c434 Subject: Re: [PHP-DEV] php interactive shell: save history on SIGINT exit From: saprykin.dmitry@gmail.com (Dmitry Saprykin) --089e011615fcea86ac04feb4c434 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C3=BCter wrot= e: > 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=3D67496. > > I have created pull request https://github.com/php/php-src/pull/727 bu= t > > 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 > > > --089e011615fcea86ac04feb4c434--