GNU bug report logs - #1388
23.0.60; Emacs shell problem with echo "1+1" | bc

Previous Next

Package: emacs;

Reported by: "Jhair Tocancipa Triana" <jhair.tocancipa <at> gmail.com>

Date: Thu, 20 Nov 2008 08:10:03 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 1388 <at> debbugs.gnu.org
Subject: bug#1388: 23.0.60; Emacs shell problem with echo "1+1" | bc
Date: Sat, 22 Nov 2008 16:02:23 -0500
Stefan Monnier wrote:

> Yes, an appropriate binding of process-connection-type at the right
> place and the right time should do the trick.

Awesome, thanks. The following seems to work, though:

i) One needs to use either /bin/echo or set eshell-plain-echo-behavior
non-nil if `echo 1+1 | bc' is to work.

ii) I'm not sure whether the following is mistakenly changing the
behaviour of the first command in a pipeline. Can't think of a good
test for that...


*** esh-proc.el.~1.21.~	2008-05-20 16:28:53.000000000 -0700
--- esh-proc.el	2008-11-22 12:55:59.000000000 -0800
***************
*** 250,260 ****
      (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)))
        (eshell-record-process-object proc)
        (set-process-buffer proc (current-buffer))
        (if (eshell-interactive-output-p)
--- 250,263 ----
      (cond
       ((fboundp 'start-process)
        (setq proc
+ 	    ;; Bug#1388.  Some commands (eg bc) check isatty to decide
+ 	    ;; whether they are being called interactively.
+ 	    (let ((process-connection-type (unless eshell-in-pipeline-p
+ 					     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)




This bug report was last modified 15 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.