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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26744 invoked from network); 25 Jul 2020 04:03:40 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 25 Jul 2020 04:03:40 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 82DDA9C9FA; Sat, 25 Jul 2020 14:03:37 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 39FEB9C9DB; Sat, 25 Jul 2020 14:02:23 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ccil-org.20150623.gappssmtp.com header.i=@ccil-org.20150623.gappssmtp.com header.b="HtZA//9s"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 122F39C8B1; Sat, 25 Jul 2020 14:02:20 +1000 (AEST) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by minnie.tuhs.org (Postfix) with ESMTPS id 376BD9BA4F for ; Sat, 25 Jul 2020 14:02:19 +1000 (AEST) Received: by mail-qv1-f53.google.com with SMTP id el4so5035866qvb.13 for ; Fri, 24 Jul 2020 21:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fKqGy/diIVUqmhSRgJJr1OsvyAZ5fFTrL6xp3X7HsIc=; b=HtZA//9sWPhKIP8Iigny3F855WVweCzh+uWANEfda/uRl9KwVTDrl2YhICJ+gGpMM0 rn4KBc9yg/+34+oFSZ6xMN1sWTeTSAnxZd/Up/d4IE8MEQlWnvK8dxbsSAQf+6nlJXwm wflMeCefF7cPPprhX109j3u7QfUjdkKHXsYKS8sIfleYdigSkEQiVNnK3EGVwCW1u6OG cJGLtfNlGgiD3MfaZXsf6dw1CYUzxXat4t7mHu3BFjWti5S7bV+Bkt16qqAs35LptJW/ 4dcTtuWPRpdFPaBnO8REI9o8TjiwQbK4fycR9SkBjUjQVnPgcyeaLlk2nKzhf2XScZK3 jbzA== 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=fKqGy/diIVUqmhSRgJJr1OsvyAZ5fFTrL6xp3X7HsIc=; b=hoLXemwG/yRb3bTrgm/3ye9UDnT2mdpchoHgNQJY6ZiCAXiBGZ6u5uRm+fJ7U/xua2 6Gfc8OJ19qLW4J2vr8IL4HQfhSIxsmOfOcGUy/fEpSCVO5rnge3C5NonIBDOSQy3sPan lLt56ApbxuUKS0MWZzYurxqVv904Ylfed9uaokvl9d6T/+vkrhZsFV6PhwF4QvAbm350 uPkn9WmSa5yMofLqZpvI26XnFZJZBV8tXz3d8Izp0ou8hudY2WvzNwI5ehMhCbFxddwg MP3QZUaSjJtMD41ArhJJHh1bz+I1bSwnrwNTb3aKXBZ+tMDVqkPeNjtKBvl+DRr0ld7D 2OHA== X-Gm-Message-State: AOAM530i0xXWPe0Z5KeKwMT9i+Co0YjQXGn7frVfg8WidoOLdl8hZTVk vmFWkYMZKf/9jaohZfB/ZQqMLzVPKQVoHjvr3Xi4OMkZxZE= X-Google-Smtp-Source: ABdhPJz/Vrq2xN8ZQ60k+2quhSJyWmLIyzfNlVlZhPYaBnV57cBazxbhXiQcDJEFYr/V8YJIj7Ta9MjeQeNmMaB2egs= X-Received: by 2002:a05:6214:14e5:: with SMTP id k5mr13071424qvw.125.1595649738334; Fri, 24 Jul 2020 21:02:18 -0700 (PDT) MIME-Version: 1.0 References: <20200724022807.D9E1E18C073@mercury.lcs.mit.edu> In-Reply-To: From: John Cowan Date: Sat, 25 Jul 2020 00:02:07 -0400 Message-ID: To: Paul Riley Content-Type: multipart/alternative; boundary="000000000000d6fb1305ab3c27a0" 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" --000000000000d6fb1305ab3c27a0 Content-Type: text/plain; charset="UTF-8" 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 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 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*.. >> >> --000000000000d6fb1305ab3c27a0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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.

<= /div>
Note that if a program gets stuck=C2=A0in rare mode rather than r= aw 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. Gl= ad 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 c= an run it!

In answer to the CR question, is it that in r= aw mode, the CR does not get mapped to LF, and therefore the shell doesn= 9;t see the LF character and recognize the end of the line? Incidentally, w= hy the ^J before ft? Just to clean up the shell input status?
I'll write my own ft, thanks. I'll try raw mode, becaus= e I want some better line editing capability.

Alte= rnatively if I toy around with /dev/tty does that interfere with the operat= ion of the standard console outside of my app?

Pau= l

<= div>
Paul Riley




On Fri, 24 Jul 2020 at 22:36, Clem Cole= <clemc@ccc.com&g= t; wrote:


On Thu, Jul 23, 2020 at 10:29 PM N= oel 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..

--000000000000d6fb1305ab3c27a0--