Commit 283efe5ae4c2c09e4e57e3797383a336a09d190b

Thomas de Grivel 2014-10-03T12:11:19

Print shell pid and command.

diff --git a/shell/sb-shell.lisp b/shell/sb-shell.lisp
index 5a6e19d..1643152 100644
--- a/shell/sb-shell.lisp
+++ b/shell/sb-shell.lisp
@@ -23,7 +23,12 @@
 (defclass sb-shell (shell)
   ((process :type sb-impl::process
 	    :initarg :process
-	    :reader shell-process)))
+	    :reader shell-process)
+   (command :type string
+	    :initarg command
+	    :reader shell-command)))
+
+;;  Shell infos
 
 (defmethod shell-close ((shell sb-shell))
   (format t "~&Closing shell : ~A~%" shell)
@@ -37,6 +42,10 @@
 (defmethod shell-pid ((shell sb-shell))
   (sb-ext:process-pid (shell-process shell)))
 
+(defmethod print-object ((shell sb-shell) stream)
+  (print-unreadable-object (shell stream :type t)
+    (format stream "~D ~S" (shell-pid shell) (shell-command shell))))
+
 (defun make-shell (&optional (command *default-shell-command*) &rest args)
   (format t "~&Opening shell : ~A~{ ~A~}~%" command args)
   (force-output)
@@ -46,7 +55,10 @@
 				     :output :stream
 				     :error :stream)))
     (unwind-protect
-	 (let ((shell (make-instance 'sb-shell :process process)))
+	 (let ((shell (make-instance 'sb-shell
+				     :process process
+				     :command (format nil "~A~{ ~A~}"
+						      command args))))
 	   (shell-in "true" shell)
 	   (shell-status shell)
 	   (setq process nil)