Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69197 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97933 invoked from network); 18 Sep 2013 14:34:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2013 14:34:35 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.177 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.177 mail-vc0-f177.google.com Received: from [209.85.220.177] ([209.85.220.177:37057] helo=mail-vc0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/FB-43258-9F9B9325 for ; Wed, 18 Sep 2013 10:34:34 -0400 Received: by mail-vc0-f177.google.com with SMTP id hv10so3008427vcb.22 for ; Wed, 18 Sep 2013 07:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=vIFPsnq2gNFVQopPszLc0oc7Q0OrNhuHDzNXPksvcAk=; b=FQhM3NBwO9E086weVVm2nx24RDjjbQewJzrRUUEx8JbdtgyJvcu7na/4ey1sT8NIH3 XaOSzCorUfZEEl5rDSfakoMYclFRdopLPhg9FoOxVBtO7hAcClNhzv1sbcAod13UddB6 shKbFBJazrfvNGXHkVADMWaSv6ywcmAK/OJrNt82dR2ldikXQN+Mz3P85pqPUY8PnwEO S55TQ3RxV70zNMnmJCwYW7UjzPW2SSMNyRrScCwo+0NN7t9h+y2V+VGHpuVCcRO6ZtEP 57o8le6GJhIcxvwmJKFxClO3+DQWn2UXT9KQHF12HntpexO0+9OwZfRBjOhomN8kDwPD ENqA== X-Received: by 10.220.237.208 with SMTP id kp16mr38017238vcb.4.1379514871135; Wed, 18 Sep 2013 07:34:31 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.73.197 with HTTP; Wed, 18 Sep 2013 07:33:50 -0700 (PDT) In-Reply-To: <20130918142052.GK20925@phcomp.co.uk> References: <20130914114540.GF3919@phcomp.co.uk> <523763A1.2090607@divbyzero.net> <20130917002719.GM3919@phcomp.co.uk> <5237F6AA.9030209@fedoraproject.org> <20130918140444.GI20925@phcomp.co.uk> <5239B513.1010204@fedoraproject.org> <20130918142052.GK20925@phcomp.co.uk> Date: Wed, 18 Sep 2013 16:33:50 +0200 X-Google-Sender-Auth: 0BoBXeeCatrPN557O_hKrXqwU5E Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=047d7b343464db408204e6a95580 Subject: Re: [PHP-DEV] PHP CLI setting cooked terminal mode From: jpauli@php.net (Julien Pauli) --047d7b343464db408204e6a95580 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 18, 2013 at 4:20 PM, Alain Williams wrote: > On Wed, Sep 18, 2013 at 04:13:39PM +0200, Remi Collet wrote: > > Le 18/09/2013 16:04, Alain Williams a =E9crit : > > > > > What is needed is for this to NOT be called if the standard output is > not > > > connected to a tty. > > > > From your previous message: > > > > > ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon > echo ...}) =3D 0 > > > ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon > echo ...}) =3D 0 > > > > Which is standard input, not standard output > > Yes - a typeo, sorry. > > > I can get it to not do this by connecting stdin to /dev/null: > > > > ./myScript < /dev/null | less > > > > qed > > > > > Should I raise this as a bug ? > > > > So, I don't think there is any bug there. > > The redirection of stdin to /dev/null is NOT a solution. You don't need t= o > do > this with scripts written in other languages (eg shell, perl). It makes > using > the script for the end user more difficult and strangely different from > scripts > written in other languages. > > One could use ltrace -l to trace library calls. On my laptop (Debian) : ltrace -l /usr/lib/x86_64-linux-gnu/libedit.so.2 php -a using_history(1, 38, 0x250000000f, 712, 0x1087900) =3D= 0 Interactive shell tilde_expand(0xd48ef1, 0x24a0ae8, 0, 17, 149464) =3D 0x24c61c0 read_history(0x24c61c0, 0x7f0a6eb9f986, 0x8e0f5f, 0x7f0a6eb9f986, 0) =3D= 0 readline("php > "php > Julien.Pauli --047d7b343464db408204e6a95580--