repl-reader only prompts if no input is available
authorAndy Wingo <wingo@pobox.com>
Fri, 9 Apr 2010 11:33:20 +0000 (13:33 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 9 Apr 2010 11:33:20 +0000 (13:33 +0200)
* module/ice-9/boot-9.scm (repl-reader): For the default (non-readline)
  repl reader, only display the prompt if input isn't already available.
  Fixes spurious prompts in the debugger.

module/ice-9/boot-9.scm

index f0877b7..ffd1f68 100644 (file)
@@ -2934,7 +2934,8 @@ module '(ice-9 q) '(make-q q-length))}."
 ;;; the readline library.
 (define repl-reader
   (lambda (prompt . reader)
-    (display (if (string? prompt) prompt (prompt)))
+    (if (not (char-ready?))
+        (display (if (string? prompt) prompt (prompt))))
     (force-output)
     (run-hook before-read-hook)
     ((or (and (pair? reader) (car reader))