aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/running.lisp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/running.lisp b/lib/running.lisp
index 3289e75..b3a0b52 100644
--- a/lib/running.lisp
+++ b/lib/running.lisp
@@ -42,18 +42,15 @@ with SHELL-NAME. The output from the command read line by line and is
printed to OUTPUT-STREAM. "
(let ((shell
(uiop:launch-program shell-name :input :stream :output :stream)))
- (symbol-macrolet ((shell-input (uiop:process-info-input shell))
- (shell-output (uiop:process-info-output shell)))
+ (let ((shell-input (uiop:process-info-input shell))
+ (shell-output (uiop:process-info-output shell)))
(write-line command shell-input)
(finish-output shell-input)
- (if (and await-output-p
- (plusp await-output-p)
- (wait-until (:timeout await-output-p :poll-every 0.005)
- (listen shell-output)))
- (loop while (listen shell-output)
- do (princ (read-line shell-output) output-stream)
- (terpri output-stream)
- (sleep 0.005))))))
+ (when (and await-output-p (plusp await-output-p))
+ (loop while (wait-until (:timeout await-output-p :poll-every 0.05)
+ (listen shell-output))
+ do (princ (read-line shell-output) output-stream)
+ (terpri output-stream))))))