diff options
author | Glenn Morris <rgm@gnu.org> | 2008-11-23 03:05:29 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-11-23 03:05:29 +0000 |
commit | 85bf315e34c53ad2c2ff06a55a2c879aa366a473 (patch) | |
tree | d41e56e52bd632267af19079f64f402f5879cd64 /lisp/eshell | |
parent | 4c7f2c2de1277724757fa407c827c49664e364d4 (diff) | |
download | emacs-85bf315e34c53ad2c2ff06a55a2c879aa366a473.tar.gz |
(eshell-gather-process-output):
Set process-connection-type nil for all but the first element of a
pipeline. (Bug#1388)
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/esh-proc.el | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 25d9dd64663..39fea83cd8d 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -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) |