The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Paul Riley <paul@rileyriot.com>
Cc: TUHS main list <tuhs@minnie.tuhs.org>,
	Noel Chiappa <jnc@mercury.lcs.mit.edu>
Subject: Re: [TUHS] V6 Console IO
Date: Sat, 25 Jul 2020 00:02:07 -0400	[thread overview]
Message-ID: <CAD2gp_R8_z-AZvjObWPLG18TDZ9jz1Wdf1_1isuQTLPUTmfNBg@mail.gmail.com> (raw)
In-Reply-To: <CAD05_j3KTordUZsc-pn70Q7gJJru49pyf5+8yJyRRJGbAVjD-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2831 bytes --]

Ctrl+J actually is the keystroke for U+000D LINE FEED, so it always works;
old-timers got in the habit of typing ^Jreset^J.

Note that if a program gets stuck in rare mode rather than raw mode, you
can get out of it with ^C (or whatever INTR is set to), a good reason for
using rare mode.


On Fri, Jul 24, 2020 at 10:49 PM Paul Riley <paul@rileyriot.com> wrote:

> Yep already fallen into that trap. Glad I'm running on a sim! Yes I'd
> considered writing a small program to reset the STTY settings, and you've
> helped me to understand how I can run it!
>
> In answer to the CR question, is it that in raw mode, the CR does not get
> mapped to LF, and therefore the shell doesn't see the LF character and
> recognize the end of the line? Incidentally, why the ^J before ft? Just to
> clean up the shell input status?
>
> I'll write my own ft, thanks. I'll try raw mode, because I want some
> better line editing capability.
>
> Alternatively if I toy around with /dev/tty does that interfere with the
> operation of the standard console outside of my app?
>
> Paul
>
> *Paul Riley*
>
>
>
>
> On Fri, 24 Jul 2020 at 22:36, Clem Cole <clemc@ccc.com> wrote:
>
>>
>>
>> On Thu, Jul 23, 2020 at 10:29 PM Noel Chiappa <jnc@mercury.lcs.mit.edu>
>> wrote:
>>
>>>  ...
>>> This is not a C issue; it's the Unix I/O system (and specifically,
>>> terminal I/O).
>>
>>
>>> ...
>>
>> One can suppress all this; there's a mode call 'raw'
>>>
>> Just be sure to turn raw mode off so canonization is performed again
>> after your program stops running. Remember this a 'system wide'
>> settings for that try and all programs start to use that setting.   So if
>> some reason, your program stops and a new program (like the shell) takes
>> back over input from the try, if you do not have a way to get it back you
>> are screwed.
>>
>> Back in the day, I have a shell script in my path stored in ~/.bin
>> called: ft (fix tty) which called the stty command with the way I wanted
>> the terminal to be set up.   Thus is I was running a program that core
>> dumped and left the try in raw mode, if I could find a way to run the ft
>> script (usually by typing ^Jft^J ) life was good again.  Paul, as an
>> exercise why would ft<CR> not be good enough? (hint read and study the
>> section 4 man page for stty)
>>
>> FWIW: is how the original UCB ex/vi  and Cornell's Fred editors for v6
>> works by the way.  I suspect that iyou look at any of the video editors of
>> the day it will show you the details.
>>
>> One of the differences between V7 and earlier UNIX tty handlers was that
>> they tty canonization was split into multiple parts.   Also the other hint
>> with Sixthedition's version of raw and cooked modes, you get all or nothing so
>> you if you turn on raw, your program, will have do things like backspace
>> processing, *etc*..
>>
>>

[-- Attachment #2: Type: text/html, Size: 6141 bytes --]

  reply	other threads:[~2020-07-25  4:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  2:28 Noel Chiappa
2020-07-24  4:54 ` Paul Riley
2020-07-24 16:37   ` Random832
2020-07-24 17:15     ` Clem Cole
2020-07-25  2:45       ` Random832
2020-07-24 14:34 ` Clem Cole
2020-07-25  2:48   ` Paul Riley
2020-07-25  4:02     ` John Cowan [this message]
2020-07-25 15:09       ` Clem Cole
2020-07-25 15:31         ` Richard Salz
2020-07-26  1:08           ` Random832
2020-07-27  9:11             ` Paul Riley
  -- strict thread matches above, loose matches on Subject: below --
2020-07-25 17:45 Noel Chiappa
2020-07-24 14:33 Noel Chiappa
2020-07-24 14:36 ` Clem Cole
2020-07-25  1:53   ` Dave Horsfall
2020-07-24  0:18 Paul Riley
2020-07-24  2:57 ` Larry McVoy
2020-07-24  4:41   ` Paul Riley
2020-07-24  4:54     ` Paul Riley
2020-07-24 14:01       ` Larry McVoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD2gp_R8_z-AZvjObWPLG18TDZ9jz1Wdf1_1isuQTLPUTmfNBg@mail.gmail.com \
    --to=cowan@ccil.org \
    --cc=jnc@mercury.lcs.mit.edu \
    --cc=paul@rileyriot.com \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).