* eshell/esh-ext.el (eshell-external-command): Do not examine
[bpt/emacs.git] / lisp / eshell / esh-ext.el
index 52df158..f9f9b1a 100644 (file)
@@ -209,7 +209,11 @@ causing the user to wonder if anything's really going on..."
   (setq args (eshell-stringify-list (eshell-flatten-list args)))
   ;; (if (file-remote-p default-directory)
   ;;     (eshell-remote-command command args))
-  (let ((interp (eshell-find-interpreter command)))
+  (let ((interp (eshell-find-interpreter
+                command
+                ;; Do not examine remote shell scripts.
+                (or (and (stringp command) (file-remote-p command))
+                    (file-remote-p default-directory)))))
     (cl-assert interp)
     (if (functionp (car interp))
        (apply (car interp) (append (cdr interp) args))