Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114428 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93365 invoked from network); 12 May 2021 08:40:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 May 2021 08:40:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3C6B1804B5 for ; Wed, 12 May 2021 01:48:37 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 12 May 2021 01:48:37 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id p20so4630706ljj.8 for ; Wed, 12 May 2021 01:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=22v2OBuNmQaMdBRMlRNoFiBPGhSgXO04ueMf4miD9lU=; b=HCwKdNL3+5pbnuWJBKyNdTabaOyOPVW5Ev+jtrlR3KyEMyVX11MC91l6zGTTNOupIj OFfzkXH4KH61EWa7rW3Uj0awNVkY83thYkBOWx0fyseIVUK5KSu0t9lUmsz0TOR7ZdW2 OMeMDU1NnPUPHuxfLyYt7+y0cglKj7gDWhjaq43uPcxEqzG45+d5cnlU3mpqQPCSEy/7 e5+e42qnaNmDd42eKngrpNhUM8cEHCrPVikV8MJKZSSbOh6VO7rDas8pwRPxHB91o9tV YqiBV1OjkkyPZmXGUno4xLvx/CJel3QumBfSuXTI2QGctgtxf6OHbloC0DzV2rSbr+5a crXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=22v2OBuNmQaMdBRMlRNoFiBPGhSgXO04ueMf4miD9lU=; b=W65yeldg3zMN1iSmHBUM/28g5ALQPCuM/PNN09ivqWQDK0GccBJG7rG2/rfbBspJmG Kra8AypX3Vq3GPb/nQBXEAT1KFKTw8hhCKZkrdI+IGndhJBu+QRCcnP8IL6n97GlBQyF cF1yYhwdUNR0ZS3ZbXHfpTTVkoe/JbNovYFnFGqjA2GXO7bACsyqpjNO+gYFuBHs5YCu XnqayJd4/sOZtEwyP5C+JwpJ97q+wZGMLc9rW0EPRCEwsSueh9n2BEZLgMoRMrMJHwr9 HlInIx7hy7GuLxrrdlwtDOs1nD2WiP10Rtt3UAASi9BXgMusqLh5CT5f3QP+LOz0tIdL //eg== X-Gm-Message-State: AOAM5319iLtrMqqDaRWhzFqtgqkZUqwSEQgBTu5qqmfXT+AKehnisaAe 2Kvoc74yMA5i4uUWEd3Cw8TsWhnk0kArWlpsERnAysTSkxI= X-Google-Smtp-Source: ABdhPJyaKZ0Vyxmsg6Q+Ul9SsPNRsp2viho7qGu9nd4blWbchZopPoXOhrc84qy+gKVGczrxyQr391ykRUB7TGZu4pg= X-Received: by 2002:a2e:1516:: with SMTP id s22mr28726009ljd.109.1620809313306; Wed, 12 May 2021 01:48:33 -0700 (PDT) MIME-Version: 1.0 References: <3B7C1AC0-9CC0-4B88-A610-64AB6A364B36@9dev.de> In-Reply-To: <3B7C1AC0-9CC0-4B88-A610-64AB6A364B36@9dev.de> Date: Wed, 12 May 2021 10:48:17 +0200 Message-ID: To: Moritz Friedrich Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000005e4b4805c21e1355" Subject: Re: [PHP-DEV] Disable interactive mode (-a) if readline not available From: nikita.ppv@gmail.com (Nikita Popov) --0000000000005e4b4805c21e1355 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 12, 2021 at 10:37 AM Moritz Friedrich wrote: > > > Am 12.05.2021 um 10:12 schrieb Nikita Popov : > > > > Hi internals, > > > > 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. > > > > I think the current behavior is quite confusing, because it's really no= t > > 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. > > > > I think we would be better off disabling -a completely if readline is n= ot > > available, and exit with a helpful error message. I've opened > > https://github.com/php/php-src/pull/6976 to that effect. Does that soun= d > > reasonable? > > > > Regards, > > Nikita > > Hi Nikita, > if I may ask, would it also be possible to have deadline as a mandatory > dependency to always have the interactive shell available? Is there a goo= d > reason to compile PHP without? Having a basic prompt available is really > handy at times =E2=80=94 especially looking at Node.js with their ahead-c= ompletion > and general UX. > The same has been done for other PHP modules in the past, so I wonder if > we could simply have readline as a guarantee. The readline extension has an external dependency on readline / libedit. Making it a required extension would also make this a required dependency. We avoid having dependencies for the minimal build. The only dependency we currently have is libpcre, and we vendor that one. I doubt we'll want to add a new vendored dependency, as they tend to be a major pain. I personally do not use the interactive shell (and I think most people who do use *an* interactive shell prefer psysh), so I don't think this can be reasonably considered a "required" feature. Regards, Nikita --0000000000005e4b4805c21e1355--