]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell-gather-process-output):
authorGlenn Morris <rgm@gnu.org>
Sun, 23 Nov 2008 03:05:51 +0000 (03:05 +0000)
committerGlenn Morris <rgm@gnu.org>
Sun, 23 Nov 2008 03:05:51 +0000 (03:05 +0000)
Set process-connection-type nil for all but the first element of a
pipeline.  (Bug#1388)

lisp/ChangeLog
lisp/eshell/esh-proc.el

index a39021dce292010a13728fedd98644b4c3a59506..2f93e13e140d28e4857ae51c58c3eee60084f0c6 100644 (file)
@@ -1,3 +1,14 @@
+2008-11-23  Glenn Morris  <rgm@gnu.org>
+
+       * eshell/esh-cmd.el (eshell-in-pipeline-p): Add doc-string.
+       (eshell-do-pipelines): Add optional argument to distinguish recursive
+       calls.  Use to set eshell-in-pipeline-p to 'first for the first command
+       in a pipeline.
+
+       * eshell/esh-proc.el (eshell-gather-process-output):
+       Set process-connection-type nil for all but the first element of a
+       pipeline.  (Bug#1388)
+
 2008-11-22  Juri Linkov  <juri@jurta.org>
 
        * dired-aux.el (dired-isearch-filenames): Add new context-dependent
index 25d9dd6466390512c3d78a27b9a519b5b53d5c01..39fea83cd8d3c2d5ff81eaea738ae62a93bde6f1 100644 (file)
@@ -250,11 +250,27 @@ Used only on systems which do not support async subprocesses.")
     (cond
      ((fboundp 'start-process)
       (setq proc
-           (apply 'start-process
-                  (file-name-nondirectory command) nil
-                  ;; `start-process' can't deal with relative
-                  ;; filenames
-                  (append (list (expand-file-name command)) args)))
+           ;; Bug#1388.  Some commands (eg bc) check isatty to decide
+           ;; whether they are being called interactively.
+           ;; A normal shell pipeline has:
+           ;; first: stdin tty , stdout pipe
+           ;; rest : stdin pipe, stdout pipe
+           ;; last : stdin pipe, stdout tty
+           ;; We have:
+           ;; first: stdin tty , stdout tty
+           ;; last : stdin pipe, stdout pipe
+           ;; In other words, the first and last elements have the
+           ;; wrong kind of stdout.  (Perhaps this does not matter much...)
+           ;; FIXME which is better for the first element:
+           ;; tty/tty (as now), or pipe/pipe?
+           (let ((process-connection-type
+                  (unless (and eshell-in-pipeline-p
+                               (not (eq eshell-in-pipeline-p 'first)))
+                    process-connection-type)))
+             (apply 'start-process
+                    (file-name-nondirectory command) nil
+                    ;; `start-process' can't deal with relative filenames
+                    (append (list (expand-file-name command)) args))))
       (eshell-record-process-object proc)
       (set-process-buffer proc (current-buffer))
       (if (eshell-interactive-output-p)