GNU bug report logs - #1279
color output from external programs not working by default in eshell

Previous Next

Package: emacs;

Reported by: David Miani <nanothief <at> gmail.com>

Date: Thu, 30 Oct 2008 16:50:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1279 in the body.
You can then email your comments to 1279 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1279; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to David Miani <nanothief <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: David Miani <nanothief <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org, jasonspiro4 <at> gmail.com
Subject: color output from external programs not working by default in eshell
Date: Fri, 31 Oct 2008 02:39:44 +1000
[Message part 1 (text/plain, inline)]
When running eshell, using an external program that outputs in color results 
in the raw terminal escape codes being displayed. For example,
~ $ yaourt -Ss emacs
^[[3m^[[1;32mextra/^[[0m^[[0m^[[1memacs ^[[1;32m22.3-1 
^[[7m^[[1;33m[installed]^[[0m ^[[1;34m^[[0m
^[[3m     The Emacs Editor^[[0m
^[[3m^[[1;32mextra/^[[0m^[[0m^[[1msnd ^[[1;32m10.1-1^[[0m ^[[1;34m^[[0m
^[[3m     Snd is the emacs of sound editor^[[0m
^[[3m^[[1;32mextra/^[[0m^[[0m^[[1mtexmacs ^[[1;32m1.0.6.14-1^[[0m 
^[[1;34m^[[0m
^[[3m     GNU TeXmacs is a free scientific text editor, which was both 
inspired by TeX^[[0m
...

However, if the following code is used in ~/.emacs (code found at 
http://www.emacswiki.org/emacs/EshellColor):
    (require 'ansi-color)
    (require 'eshell)
    (defun eshell-handle-ansi-color ()
      (ansi-color-apply-on-region eshell-last-output-start
                                  eshell-last-output-end))
    (add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color)

the output is correctly displayed in color as:
$ yaourt -Ss emacs
extra/emacs 22.3-1 [installed] 
     The Emacs Editor
extra/snd 10.1-1 
     Snd is the emacs of sound editor
extra/texmacs 1.0.6.14-1 
     GNU TeXmacs is a free scientific text editor, which was both inspired by 
TeX
...

I think that this should be included and enabled by default with eshell, as it 
doesn't change existing behaviour for non-color output, it only makes color 
output readable. I have a fair few programs that output in color, and the 
default behaviour made eshell unusable for me.

In GNU Emacs 22.3.1 (i686-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-09-09 on p15200770.pureserver.info
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--prefix=/usr' '--sysconfdir=/etc' '--
libexecdir=/usr/lib' '--localstatedir=/var' '--mandir=/usr/share/man' '--
without-sound' '-with-x-toolkit=gtk' 'CFLAGS=-march=i686 -mtune=generic -O2 -
pipe''


[Message part 2 (text/html, inline)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1279; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Miani <nanothief <at> gmail.com>
Cc: 1279 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org,
        jasonspiro4 <at> gmail.com
Subject: Re: bug#1279: color output from external programs not working by default in eshell
Date: Thu, 30 Oct 2008 23:36:24 -0400
> When running eshell, using an external program that outputs in color results 
> in the raw terminal escape codes being displayed. For example,
> ~ $ yaourt -Ss emacs
> ^[[3m^[[1;32mextra/^[[0m^[[0m^[[1memacs ^[[1;32m22.3-1 
> ^[[7m^[[1;33m[installed]^[[0m ^[[1;34m^[[0m
> ^[[3m     The Emacs Editor^[[0m
> ^[[3m^[[1;32mextra/^[[0m^[[0m^[[1msnd ^[[1;32m10.1-1^[[0m ^[[1;34m^[[0m
> ^[[3m     Snd is the emacs of sound editor^[[0m
> ^[[3m^[[1;32mextra/^[[0m^[[0m^[[1mtexmacs ^[[1;32m1.0.6.14-1^[[0m 
> ^[[1;34m^[[0m
> ^[[3m     GNU TeXmacs is a free scientific text editor, which was both 
> inspired by TeX^[[0m
> ...

FWIW, I consider it a bug for such programs to output ANSI escape
sequences for color unless they have some concrete evidence that the
terminal to which they talk does understand those escape sequences.

What does $TERM say in your shell?  Is this terminal type known to
support color?  If so, specifying such a terminal type is an error and
we try and figure out where it comes from so we can fix it.


        Stefan





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1279; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1279; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to nanothief <at> gmail.com:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #20 received at 1279 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: nanothief <davidmiani <at> gmail.com>
To: 1279 <at> debbugs.gnu.org
Subject: Re: bug#1279: color output from external programs not working by default in eshell
Date: Sat, 1 Nov 2008 12:27:15 +1000
[Message part 1 (text/plain, inline)]
> What does $TERM say in your shell?  Is this terminal type known to
> support color?  If so, specifying such a terminal type is an error and
> we try and figure out where it comes from so we can fix it.
Well running in eshell echo $TERM gives no output. and I often get the error 
message "tput: No value for $TERM and no -T specified". Running the command 
export TERM="dumb" stops the error messages, but the program still outputs in 
color.

Note that the program probably doesn't work correctly with a non-color shell, 
as it is meant as an advancement on another program, so it is unlikely the 
developers tested it with a non-color term. 

However, I'm not sure how relevant this is to this bug, as if eshell can be 
made to work easily with color, then why not set it as default?
[Message part 2 (text/html, inline)]

Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Thu, 22 Jan 2009 04:55:03 GMT) Full text and rfc822 format available.

Notification sent to David Miani <nanothief <at> gmail.com>:
bug acknowledged by developer. (Thu, 22 Jan 2009 04:55:04 GMT) Full text and rfc822 format available.

Message #25 received at 1279-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: 1279-done <at> debbugs.gnu.org
Subject: Re: color output from external programs not working by default in eshell
Date: Wed, 21 Jan 2009 23:46:53 -0500
The 2009-01-21 checkin by John Wiegley fixes this.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 19 Feb 2009 15:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 125 days ago.

Previous Next


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