Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114448 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55721 invoked from network); 12 May 2021 15:31:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 May 2021 15:31:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E864B1804D9 for ; Wed, 12 May 2021 08:39:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mercury.negativeion.net (mercury.negativeion.net [199.38.81.6]) by php-smtp4.php.net (Postfix) with ESMTP for ; Wed, 12 May 2021 08:39:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 2CEE420D8001B5; Wed, 12 May 2021 11:39:28 -0400 (EDT) Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QMFfGKKj6f1D; Wed, 12 May 2021 11:39:27 -0400 (EDT) Received: from [10.0.1.101] (unknown [173.225.146.47]) by mercury.negativeion.net (Postfix) with ESMTPSA id 87CC620D8001A7; Wed, 12 May 2021 11:39:27 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) In-Reply-To: Date: Wed, 12 May 2021 10:39:26 -0500 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Nikita Popov X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] Disable interactive mode (-a) if readline not available From: aaron@trowski.com (Aaron Piotrowski) > On May 12, 2021, at 3:12 AM, Nikita Popov = wrote: >=20 > Hi internals, >=20 > If the readline extension is enabled, PHP provides an interactive = shell > under -a. If it is not enabled, it falls back to an "interactive mode" > (yes, the difference between "interactive shell" and "interactive = mode" is > important here). The interactive mode is simply an stdin input, which = needs > to be terminated using Ctrl+D. You can only run one script that way. >=20 > I think the current behavior is quite confusing, because it's really = not > obvious that you ended up in this fallback mode (you need to know the > difference between "shell" and "mode" in the output) and most people > wouldn't know what to do with it. The latest instance of this is > https://bugs.php.net/bug.php?id=3D81033. >=20 > I think we would be better off disabling -a completely if readline is = not > available, and exit with a helpful error message. I've opened > https://github.com/php/php-src/pull/6976 to that effect. Does that = sound > reasonable? >=20 > Regards, > Nikita This would have been helpful several years ago when I started compiling = PHP myself and was confused why `php -a` broke. An error message would = have saved me some time. So yes, please, merge it. Aaron Piotrowski=