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 18696 invoked from network); 25 Jul 2020 02:49:50 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 25 Jul 2020 02:49:50 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 585759C8B1; Sat, 25 Jul 2020 12:49:48 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 91EDB9C9F1; Sat, 25 Jul 2020 12:48:25 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id E3D0D9C8B1; Sat, 25 Jul 2020 12:48:21 +1000 (AEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by minnie.tuhs.org (Postfix) with ESMTPS id 49E209BA4F for ; Sat, 25 Jul 2020 12:48:21 +1000 (AEST) Received: by mail-pj1-f44.google.com with SMTP id o22so6511528pjw.2 for ; Fri, 24 Jul 2020 19:48:21 -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=lEw5LTS/E+3BD86tcXxCNmRNkB8fCEaGxqIy3LwMDbk=; b=WY9f/x28NUXkoK5kjFwdR7E0NoKcPcmmSa8hVcQWCtTEwRan9JuC8b/bnqTJ9Pw00E /5abz0Fb4ZM1xBxKo90rMmCTplhfuRJ27a6V3c+9Cj1io/1vHWClZ5kygwmf0z0v8yC5 zzmmrVXhwW2nir3qCZCJvytfwiqPAXJga2ofB2T9HOQhrLOl5iLwxgCctBi0W2dac7D+ i2k4e/eIqHXSrAQN2wNeHUZVCiRu9A8fqeOfGjAiT9ZHOXZujME0xVYjyydRQ/Cteg3Z NIOCZeitESIzGWbpqlLUlDC+XTef8BoKS3Q6ItQ2Voyj6gCL55ElCCORhV92lhyui0Ri UoVw== X-Gm-Message-State: AOAM531uMaJdyIFYTDauFfd9lAdxQEb++BAZeJ98hA+WuPQkN+aEh8Ok sxDRofYCu0yc7DPC+c/oWJzUgxv+ObhI+Daamfne2XFr X-Google-Smtp-Source: ABdhPJzEJuAqS891ij5fht5oloWa6iN4StX3illlO2NatC5lrjVcKajOPpNP3Su5k62tnpgseZUTqchH6kJElvBI72k= X-Received: by 2002:a17:90a:cb81:: with SMTP id a1mr8347439pju.11.1595645300542; Fri, 24 Jul 2020 19:48:20 -0700 (PDT) MIME-Version: 1.0 References: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> In-Reply-To: From: Paul Riley Date: Sat, 25 Jul 2020 10:48:07 +0800 Message-ID: To: Clem Cole Content-Type: multipart/alternative; boundary="00000000000053906005ab3b1f2d" 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 main list , Noel Chiappa Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --00000000000053906005ab3b1f2d Content-Type: text/plain; charset="UTF-8" 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 wrote: > > > On Thu, Jul 23, 2020 at 10:29 PM Noel Chiappa > 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 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*.. > > --00000000000053906005ab3b1f2d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 se= ttings, 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 charac= ter 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 ar= ound with /dev/tty does that interfere with the operation of the standard c= onsole 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:
=C2=A0...
This is not a C issue; it's the Unix I/O system (and specifically, term= inal I/O).=C2=A0

...=C2=A0
One can suppress all this; there's a mode call '= raw'=C2=A0
Just be sure to turn raw mode off s= o canonization is performed again after your program stops running. Remembe= r this a 'system wide' settings=C2=A0for that try and all programs = start to use that setting.=C2=A0 =C2=A0So if some reason, your program stop= s 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.=C2=A0

Back in the day, I have a shell script in my path sto= red in ~/.bin called: ft <= font face=3D"arial, helvetica, sans-serif">(fix tty) which called the stty = command with the way I wanted the terminal=C2=A0to be set up.=C2=A0 =C2=A0<= /font>Thus is I was running a p= rogram that core dumped and left the try in raw mode, if I could find a way= to run the ft script (usually by typing <= /span>^Jft^J=C2=A0) life was good again.=C2=A0 = Paul, as an exercise=C2=A0why would ft<CR> not= be good enough? (hint read and study the section 4 man page for stty)
=C2=A0
FWIW: is how the original UCB e= x/vi=C2=A0 and Cornell's Fred editors for v6 works by the way.=C2=A0 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 mu= ltiple parts.=C2=A0 =C2=A0Also the other hint with Sixthedition's versi= on of raw and cooked modes, you get all or nothing=C2=A0so you if you turn on raw, your program= , will have do things like backspace processing, etc..

--00000000000053906005ab3b1f2d--