#| -*-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
(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))))