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 9702 invoked from network); 24 Jul 2020 01:30:42 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 24 Jul 2020 01:30:42 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id C08B99C9E0; Fri, 24 Jul 2020 11:30:40 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id E72C79C9F0; Fri, 24 Jul 2020 11:29:07 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id CA2749C9DC; Fri, 24 Jul 2020 10:18:51 +1000 (AEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by minnie.tuhs.org (Postfix) with ESMTPS id 2174D9C9DF for ; Fri, 24 Jul 2020 10:18:51 +1000 (AEST) Received: by mail-pl1-f179.google.com with SMTP id w17so3469095ply.11 for ; Thu, 23 Jul 2020 17:18:51 -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:from:date:message-id:subject:to; bh=LdKbGGJyXM7RdUdhv8RN388cRzK+3NhszM8NNmNU3Yg=; b=irvuUE+npx01mwy9YNrpicxCDQxVE4+Ag54Geh9S9BKNtlCoAG0p+nd4zeYaklefU9 mAf4ZN6U+XzWTDaR89mCBq897/N/dC9j2V2XCnUJWSoCo60+uv+lYkxumLQKQbRil+fz SeBRDXfBdsf274PKAOKG6is8hPmSxjdDQ5dgjd5VkYy4UhNKRySbo/PgjycWWE5Qfz0P I9Y+1/Vx6c0/EGhlps+vRaORBYXSfah1Q2UMlsN/ni4/gcQVCj/3f8LDsJi6Toh5uAQ1 g402LBgqQi16KP856FWIL3Buw3HpBsecB1ZY1f+8fdrYNc2HS3ULAhrXBw9+woDPVXfk pSqA== X-Gm-Message-State: AOAM532t3aLg3W8Q72y6jZ+CUGt/JahpnyDnL0MmSG//FlEELiIfeu7X j4y9dTVmTt3+S0/LUPNS5Z9k/4+xDJrIs7tA5bGkHHsJv0M= X-Google-Smtp-Source: ABdhPJxv872hBE06RTvopf9WgadGKPZBS/mfXtYdhkWVIjSiuUvfKNgrgFSTrkeik6w1PaMeeyACyaJoD1OuXRgFn1k= X-Received: by 2002:a17:90a:c207:: with SMTP id e7mr2819486pjt.49.1595549930254; Thu, 23 Jul 2020 17:18:50 -0700 (PDT) MIME-Version: 1.0 From: Paul Riley Date: Fri, 24 Jul 2020 08:18:26 +0800 Message-ID: To: tuhs Content-Type: multipart/alternative; boundary="000000000000d073e405ab24eab4" Subject: [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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000d073e405ab24eab4 Content-Type: text/plain; charset="UTF-8" I am using C in V6 to create a Forth compiler. I don;t have any interest in Forth as a general purpose language, however I do like it. It's satisfying to create a language from the ground up. I'm interested in it a simple and extensible interpreted language for toying with my PDP-11s, so I'll have some with it in the future. I have a very basic problem. I am simply using getchar and putchar for console IO, which is convenient indeed. 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. When I press backspace the system responds with the character that was deleted, which is fine, as I assume it was from the paper teletype days. However, my code is receiving input and also echoing the output, but nothing appears on the terminal until I press enter, when the system displays the whole line of input, which is essentially a duplicate of what the terminal originally displayed, but with the consolidated edits. My code is reading and echoing the input character by character. Here's my question. How can I suppress the original C/Unix echo, and get my output to appear immediately? This simple sample code form the C programming manual behaves the same. int main() { int c; while ((c = getchar()) != EOF) { putchar(c); } } Paul *Paul Riley* Mo: +86 186 8227 8332 Email: paul@rileyriot.com --000000000000d073e405ab24eab4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am using C in V6 to create a Forth compiler. I don;= t have any interest in Forth as a general purpose language, however I do li= ke it. It's satisfying to create a language from=C2=A0the ground up. I&= #39;m interested in it a simple and extensible interpreted language for toy= ing with my PDP-11s, so I'll have some with it in the future.

I have a very basic problem. I am simply using getchar and = putchar for console IO, which is convenient indeed. I'm struggling howe= ver with how C processes the IO. It seems that when I type at the console, = my typing=C2=A0is immediately echoed to my terminal window. When I press ba= ckspace the system responds with the character that was deleted, which is f= ine, as I assume it was from the paper teletype days. However, my code is r= eceiving input and also echoing=C2=A0the output, but nothing appears on the= terminal=C2=A0until I press enter, when the system displays the whole line= of input, which is essentially a duplicate of what the terminal=C2=A0origi= nally displayed, but with the consolidated edits. My code is reading and ec= hoing the input character by character.

Here's= my question. How can I suppress the original C/Unix echo, and get my outpu= t to appear immediately? This simple=C2=A0sample code form the C programmin= g manual behaves the same.

int main() {
int c;=
while ((c =3D getchar()) !=3D EOF) {
putchar(c);
}
}

Paul



Paul Riley

Mo: +86 186 8227 8332

--000000000000d073e405ab24eab4--