Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69152 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71752 invoked from network); 16 Sep 2013 20:01:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2013 20:01:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=martin@divbyzero.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=martin@divbyzero.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain divbyzero.net from 87.230.111.147 cause and error) X-PHP-List-Original-Sender: martin@divbyzero.net X-Host-Fingerprint: 87.230.111.147 mx.bauer-kirch.de Linux 2.6 Received: from [87.230.111.147] ([87.230.111.147:51581] helo=mx.bauer-kirch.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/62-57385-4A367325 for ; Mon, 16 Sep 2013 16:01:41 -0400 Received: by mx.bauer-kirch.de with ESMTP id 1VLezJ-0005YP-2V for ; Mon, 16 Sep 2013 22:01:37 +0200 Message-ID: <523763A1.2090607@divbyzero.net> Date: Mon, 16 Sep 2013 22:01:37 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: PHP internals References: <20130914114540.GF3919@phcomp.co.uk> In-Reply-To: <20130914114540.GF3919@phcomp.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP CLI setting cooked terminal mode From: martin@divbyzero.net (Martin Jansen) On 14.09.13 13:45, Alain Williams wrote: > ./myScript | less > > Since less is an interactive program it puts the terminal into 'raw' mode so > that it can read characters one at a time. However, when I do the above I find > that the commands that I type to less are echoed back to me and not acted on > until I type . This is not as it should be. > > If I run the script under strace I see: > > ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 > ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0 > > What is happening is that PHP is putting the terminal into cooked mode. Are you sure it is PHP that's doing this? There are basically no calls to ioctl() (or tcsetattr() for that matter) outside of ext/ at all. - Martin