diff --git a/collects/readline/rep.ss b/collects/readline/rep.ss index 2bb64f2026..fc9de67436 100644 --- a/collects/readline/rep.ss +++ b/collects/readline/rep.ss @@ -10,4 +10,10 @@ (error 'readline-input "invoke this library when the current-input-port is stdin")) - (current-prompt-read read-cmdline-syntax)) + (current-prompt-read + (let ([orig-read (current-prompt-read)] + [orig-input (current-input-port)]) + (lambda () + (if (eq? (current-input-port) orig-input) + (read-cmdline-syntax) + (orig-read))))))