From: Chris Hanson Date: Fri, 10 Sep 2004 18:01:36 +0000 (+0000) Subject: Fix problem with console echoing in READ-FINISH. X-Git-Tag: 20090517-FFI~1593 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=475249ac71c2e2cdd5e3f541b9d04394a41e34ea;p=mit-scheme.git Fix problem with console echoing in READ-FINISH. --- diff --git a/v7/src/runtime/ttyio.scm b/v7/src/runtime/ttyio.scm index f0f7961e6..2946c9a92 100644 --- a/v7/src/runtime/ttyio.scm +++ b/v7/src/runtime/ttyio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: ttyio.scm,v 1.17 2004/02/16 05:39:09 cph Exp $ +$Id: ttyio.scm,v 1.18 2004/09/10 18:01:36 cph Exp $ Copyright 1991,1993,1996,1999,2003,2004 Massachusetts Institute of Technology @@ -105,22 +105,27 @@ USA. (fresh-line port) (write-string "End of input stream reached" port))) (%exit))) - (if (and char - (cstate-echo-input? (port/state port)) - (not (nearest-cmdl/batch-mode?))) - (output-port/write-char port char)) + (maybe-echo-input port char) char)) (define (operation/read-finish port) (let loop () (if (input-port/char-ready? port) - (let ((char (input-port/read-char port))) + (let ((char (generic-io/read-char port))) (if (not (eof-object? char)) (if (char-whitespace? char) - (loop) + (begin + (maybe-echo-input port char) + (loop)) (input-port/unread-char port char)))))) (output-port/discretionary-flush port)) +(define (maybe-echo-input port char) + (if (and char + (cstate-echo-input? (port/state port)) + (not (nearest-cmdl/batch-mode?))) + (output-port/write-char port char))) + (define (operation/clear port) (output-port/write-string port ((ucode-primitive tty-command-clear 0))))