From fd28c3c78f14a87f6edcb19e344d1e7f3800a469 Mon Sep 17 00:00:00 2001
From: "Robert P. Goldman" <rpgoldman@sift.net>
Date: Fri, 19 Mar 2021 09:07:57 -0500
Subject: [PATCH] T for output unsupported on LispWorks.

On guidance from LispWorks, have made T an unsupported option for `:output` and `:error-output` on LW.
---
 test/test-run-program-unix.script | 26 +++++++++++++++++++++-----
 uiop/launch-program.lisp          |  7 ++++++-
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/test/test-run-program-unix.script b/test/test-run-program-unix.script
index a926451e3..7429542a5 100644
--- a/test/test-run-program-unix.script
+++ b/test/test-run-program-unix.script
@@ -212,14 +212,30 @@
 
 (define-test
     "launch-program :output t"
-    (launch-program (list "echo" "echoing output")
-                 :output t))
+    (catch 'unimplemented
+     (handler-bind
+         (
+          #+lispworks
+          (not-implemented-error
+            #'(lambda (x)
+                (format t "~&This behavior is expected to be unimplemented on this lisp.~%")
+                (throw 'unimplemented t))))
+       (launch-program (list "echo" "echoing output")
+                       :output t))))
 
 (define-test
     "launch-program :error-output t"
-    (uiop:wait-process
-     (launch-program (format nil "./exiter.sh 0 ~a" output-string)
-                     :error-output t)))
+    (catch 'unimplemented
+     (handler-bind
+         (
+          #+lispworks
+          (not-implemented-error
+            #'(lambda (x)
+                (format t "~&This behavior is expected to be unimplemented on this lisp.~%")
+                (throw 'unimplemented t))))
+       (uiop:wait-process
+        (launch-program (format nil "./exiter.sh 0 ~a" output-string)
+                        :error-output t)))))
 
 (define-test
     ":output <file> (file e.)"
diff --git a/uiop/launch-program.lisp b/uiop/launch-program.lisp
index 62754456d..a5bd32026 100644
--- a/uiop/launch-program.lisp
+++ b/uiop/launch-program.lisp
@@ -168,8 +168,13 @@ argument to pass to the internal RUN-PROGRAM"
                                      role specifier))
              (t (parameter-error "~S IO specifier invalid for ~S" specifier role))))
       ((eql t)
+       #+lispworks
+       (not-implemented-error :interactive-output
+                              "On this lisp implementation, cannot interpret ~a value of ~a"
+                              specifier role)
+       #-lispworks
        (cond ((eq role :error-output) *error-output*)
-             ((eq role :output) *standard-output*)
+             ((eq role :output) #+lispworks *terminal-io* #-lispworks *standard-output*)
              ((eq role :input) *standard-input*)))
       (otherwise
        (parameter-error "Incorrect I/O specifier ~S for ~S"
-- 
GitLab