From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 573 invoked from network); 24 Jul 2020 04:55:37 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 24 Jul 2020 04:55:37 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 8266F9C9F3; Fri, 24 Jul 2020 14:55:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id B3E5A9C8DE; Fri, 24 Jul 2020 14:54:42 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id B44509C8DE; Fri, 24 Jul 2020 14:54:41 +1000 (AEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by minnie.tuhs.org (Postfix) with ESMTPS id AF0C69C8B1 for ; Fri, 24 Jul 2020 14:54:40 +1000 (AEST) Received: by mail-pf1-f182.google.com with SMTP id m9so4433491pfh.0 for ; Thu, 23 Jul 2020 21:54:40 -0700 (PDT) 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=413a3dgHNp8QjU7TvMQ8Z96eCS6hRBOwDknWdjSPBhI=; b=CROlQss/M1C3v1+GFp7/4/qZJPKSy1zg+vD9P/FG92BKDY2oPc1BidwQ9hoCn3+bN7 IAVezINkYVcEM+gYMd2Lgwfg6Cc2U5aPSf0iU3YjoY6t9g4AH/iqlwKyCGE8EYpTWta6 ydqO5bqzTVCrDhIwxFVcvdwP7d/l9Il0JiZGeysmgL3wVgWAK+IxQaCWjw8RUjloQhu5 Ctt6tpNuxVo+aF1JAChsTpZSI+5hX6XRr7+fQ9UM7NPIBt2VVvXVivDoKNptXVC47IxG xhg1xCo/un7/q8uGT7xIW1zdIt6mSE2jvhZ3WgIbUMb/lM5uqWGdeCICjzSb2g/HhuEQ 6BRg== X-Gm-Message-State: AOAM533yNduCPBdmj2MzaJcAjSiLQQY3eWvAQDfcgOi7gyW5bLaipmm7 uyUmWKDYkpGcq1k7O+mSC36GZlj+P7KsEyb86chG+XdO X-Google-Smtp-Source: ABdhPJx0VFAjmnVjBPWX4VOhQ3ebq4wcQ8H60563s8xqW0ip3ZXE4xwDg/tlIrpy1sWBNefob+NBZGlqAlyZlf+xlqU= X-Received: by 2002:a63:571e:: with SMTP id l30mr7404654pgb.220.1595566480061; Thu, 23 Jul 2020 21:54:40 -0700 (PDT) MIME-Version: 1.0 References: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> In-Reply-To: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> From: Paul Riley Date: Fri, 24 Jul 2020 12:54:16 +0800 Message-ID: To: Noel Chiappa Content-Type: multipart/alternative; boundary="000000000000427b0705ab28c5eb" Subject: Re: [TUHS] V6 Console IO X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000427b0705ab28c5eb Content-Type: text/plain; charset="UTF-8" Noel, Thanks for your reply. I had suspected that the Unix behaviour was responsible, and you've made that clear with the "line at a time" assertion. I tried removing echo in STTY, but haven't tried raw. Paul *Paul Riley* Mo: +86 186 8227 8332 Email: paul@rileyriot.com On Fri, 24 Jul 2020 at 10:28, Noel Chiappa wrote: > > From: Paul Riley > > > I'm struggling however with how C processes the IO. It seems that > when I > > type at the console, my typing is immediately echoed to my terminal > > window. ... nothing appears on the terminal until I press enter, > when > > the system displays the whole line of input ... How > > can I suppress the original C/Unix echo, and get my output to appear > > immediately? > > This is not a C issue; it's the Unix I/O system (and specifically, > terminal I/O). > > Normally, Unix terminal input is done line-at-a-time: i.e. the read() call > to > the OS (whether for 1 character, or a large number) doesn't return until an > enire line has been typed, and [Retrurn] has been hit; then the entire > line is > available. While it's being buffered by the OS, echoing is done, and rubout > processing is also performed. > > One can suppress all this; there's a mode call 'raw' (the normal mode is > sometime labelled 'cooked') which suppresses all that, and just gives one > the > characters actually typed, as they are typed. The stty() system call can be > used to turn this on. > > See the V6 tty(IV) manual entry for more. stty() is in stty(II). > > Noel > --000000000000427b0705ab28c5eb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Noel,

Thanks for your reply.
=
I had suspected that the Unix behaviour was responsible, and= you've=C2=A0made that clear with the "line at a time" assert= ion. I tried removing echo in STTY, but haven't tried raw.
Paul


=
Paul Riley

Mo: +86 186 8227 8332

<= /div>


On Fri, 24 Jul 2020 at 10:28, Noel Chiappa <jnc@mercury.lcs.mit.edu> wrote:
=
=C2=A0 =C2=A0 > = From: Paul Riley

=C2=A0 =C2=A0 > I'm struggling however with how C processes the IO. = It seems that when I
=C2=A0 =C2=A0 > type at the console, my typing is immediately echoed to = my terminal
=C2=A0 =C2=A0 > window. ...=C2=A0 nothing appears on the terminal until = I press enter, when
=C2=A0 =C2=A0 > the system displays the whole line of input ... How
=C2=A0 =C2=A0 > can I suppress the original C/Unix echo, and get my outp= ut to appear
=C2=A0 =C2=A0 > immediately?

This is not a C issue; it's the Unix I/O system (and specifically, term= inal I/O).

Normally, Unix terminal input is done line-at-a-time: i.e. the read() call = to
the OS (whether for 1 character, or a large number) doesn't return unti= l an
enire line has been typed, and [Retrurn] has been hit; then the entire line= is
available. While it's being buffered by the OS, echoing is done, and ru= bout
processing is also performed.

One can suppress all this; there's a mode call 'raw' (the norma= l mode is
sometime labelled 'cooked') which suppresses all that, and just giv= es one the
characters actually typed, as they are typed. The stty() system call can be=
used to turn this on.

See the V6 tty(IV) manual entry for more. stty() is in stty(II).

=C2=A0 =C2=A0 Noel
--000000000000427b0705ab28c5eb--