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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31820 invoked from network); 24 Jul 2020 14:36:09 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 24 Jul 2020 14:36:09 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id CC4819C9E2; Sat, 25 Jul 2020 00:36:08 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id B05A39C8DE; Sat, 25 Jul 2020 00:35:23 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="bKN8+xBt"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 9DC3C9C8DE; Sat, 25 Jul 2020 00:35:21 +1000 (AEST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by minnie.tuhs.org (Postfix) with ESMTPS id 8685B9C8B1 for ; Sat, 25 Jul 2020 00:35:20 +1000 (AEST) Received: by mail-qt1-f178.google.com with SMTP id d27so7015680qtg.4 for ; Fri, 24 Jul 2020 07:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nSWJUF3g2ziohfYl3YT7jXm6IV9ngDz9rZUkvV7DrTI=; b=bKN8+xBtkqvog/yBV4N9u2ajVnMqUED9XnY7voWI9sY/layhPxq2Ld5hzUYnuiMMrQ F5InaNRhyqa0Bb/cPvFXmsN5qBYMSjb+Q25TyJ56RQTXjGDM1mcdn1TVrrQ/KLYAkeib oJcEe2JIJe+cu7lhc40QtJYREPflZD70fUDmA= 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=nSWJUF3g2ziohfYl3YT7jXm6IV9ngDz9rZUkvV7DrTI=; b=cukKviY5FEl45JLlVaWqrWyuB3Lx4vXIIiEXQRSzcEM/06oFHA5E9JZr0Md3hL7Z+d KmzYpwE3JCy6KOnxlto6Uh/ibBuGvoh2lunNkhQ6klqu1pmHv8WmmxuWikjJ8vloQWdC jgEj1NqpCV5XAy6/MRI57g3WIOl/rXPJumhuj1BLfAZG+ASl6uk+T+LvFBiMDIa1gt/e Y6bIXBh3DPd4k75zJyGov0AliCco3mkwHNsqP0QpOU4HStFB31gt7xZNShFVggZnURqI Kx9hbqJ+CimoNcjpnWooYh29igvgTM9KogrnziOzr7IqmS2L9jeiQSYRNvFHM2NeikGD CTTw== X-Gm-Message-State: AOAM533Gfa4qA0gJs2e4hFxL8B3ZCPzbgm1IWQYy4/LsbenbjooyB65W ApmRAvNSBlnC7BJk9SUjkZJi7dNOMFx2suswdsip5QoP/Vk= X-Google-Smtp-Source: ABdhPJwjkHwEpsWUtWovbBmGJ0PnuM0qlsoLBc+URY81Gz5kz4uHuGi0e2jeuzVykoEvh22Lr1Z21CJoyGjCL943R3o= X-Received: by 2002:aed:27d5:: with SMTP id m21mr10110517qtg.4.1595601319433; Fri, 24 Jul 2020 07:35:19 -0700 (PDT) MIME-Version: 1.0 References: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> In-Reply-To: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> From: Clem Cole Date: Fri, 24 Jul 2020 10:34:53 -0400 Message-ID: To: Noel Chiappa Content-Type: multipart/alternative; boundary="000000000000d92ac005ab30e19a" 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 Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000d92ac005ab30e19a Content-Type: text/plain; charset="UTF-8" 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*.. --000000000000d92ac005ab30e19a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Jul 23, 2020 at 10:2= 9 PM Noel Chiappa <jnc@mercur= y.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 (fix tty) = which called the stty command with the way I wanted the terminal=C2=A0to be= set up.=C2=A0 =C2=A0Thus 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 s= cript (usually by typing ^Jf= t^J=C2=A0) life was good again.=C2=A0 Paul, as an exercis= e=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 ex/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 earlie= r UNIX tty handlers was that they tty canonization was split into multiple = parts.=C2=A0 =C2=A0Also the other hint with Sixthedition's version of r= aw 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..

--000000000000d92ac005ab30e19a--