stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] [PATCH] Visual feedback if the shell couldn't execute a comm


From: David Hansen
Subject: Re: [STUMP] [PATCH] Visual feedback if the shell couldn't execute a command (SBCL only).
Date: Fri, 02 May 2008 12:46:16 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

On Fri, 2 May 2008 02:47:36 -0700 Shawn Betts wrote:

> It looks like you forgot to attach the patch.

I haven't.  It shows up on gmane.  Maybe some fascist filter in the way
that doesn't like "text/x-patch" inline attachments (hope you are old
enough to look at them)?  (BTW, you are sending html mails, in the good
old times that was a good reason to get stoned to death ;p).

diff --git a/user.lisp b/user.lisp
index 6a0b347..b45cf2d 100644
--- a/user.lisp
+++ b/user.lisp
@@ -571,7 +571,16 @@ careful. If the shell command doesn't return, it will hang 
StumpWM. In
 such a case, kill the shell command to resume StumpWM."
   (if collect-output-p
       (run-prog-collect-output *shell-program* "-c" cmd)
-      (run-prog *shell-program* :args (list "-c" cmd) :wait nil)))
+      (run-prog *shell-program*
+                :args (list "-c" cmd)
+                :wait nil
+                #+sbcl :status-hook
+                #+sbcl #'(lambda (process)
+                           ;; Bash returns with exit code 127 on "command not
+                           ;; found".  XXX: Is this sh or a bash extension?
+                           (and (not (sb-ext:process-alive-p process))
+                                (eq 127 (sb-ext:process-exit-code process))
+                                (message "Command not found: ~a" cmd))))))
 
 (defcommand-alias exec run-shell-command)
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]