[TUHS] V6 Console IO

Paul Riley paul at rileyriot.com
Fri Jul 24 14:54:16 AEST 2020


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 at rileyriot.com



On Fri, 24 Jul 2020 at 10:28, Noel Chiappa <jnc at mercury.lcs.mit.edu> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200724/532b75e6/attachment.htm>


More information about the TUHS mailing list