From unknown Sat Jun 21 04:58:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1279 <1279@debbugs.gnu.org> To: bug#1279 <1279@debbugs.gnu.org> Subject: Status: color output from external programs not working by default in eshell Reply-To: bug#1279 <1279@debbugs.gnu.org> Date: Sat, 21 Jun 2025 11:58:47 +0000 retitle 1279 color output from external programs not working by default in = eshell reassign 1279 emacs submitter 1279 David Miani severity 1279 normal thanks From nanothief@gmail.com Thu Oct 30 09:40:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.5 required=4.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 30 Oct 2008 16:40:03 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9UGdwhC005781 for ; Thu, 30 Oct 2008 09:39:59 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvaYv-0007oG-NT for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 12:39:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvaYu-0007mB-9E for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 12:39:56 -0400 Received: from [199.232.76.173] (port=43643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvaYu-0007m4-1L for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 12:39:56 -0400 Received: from hs-out-0708.google.com ([64.233.178.249]:33851) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KvaYu-00048P-3c for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 12:39:56 -0400 Received: by hs-out-0708.google.com with SMTP id 55so301894hsc.10 for ; Thu, 30 Oct 2008 09:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:date:user-agent :mime-version:content-type:content-transfer-encoding :content-disposition:message-id:from; bh=4b+fqZEUDY3Od70yfmJ5L0MzRrdALkC+mKEiM4mdb7Q=; b=X3OgY8yNPrxJ2DiEGWfqV1KX4PxjyTrQUAPg+vZwKh/7vDR4zNTIyiPVcBsSaI1NV9 JbWp0QAB6/GdFQ81GVoaThx7+fvRWY/yjJQcxlt960loEki6084IppU3nNsm2DxtCI1E rT6KMeqaZgSrRXtwjtNhJX0Yc/DHwfbKjaQts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:content-disposition:message-id:from; b=Uewcg9VsoocCYpuzaIH7kpl/Vqax1aiFY6JK4vfJn6rplnb4GUQTIyLvPzKRkXAmom dFt4M4jfoCUHGlFLkGkJV2pQo6lepT24lpkxcVw+drykjH6oOl6fLjzDim5fIHsqnoxj N71sYnrpy1pHWJidaH+hgj8hQOMx+DQGDc1G8= Received: by 10.142.13.13 with SMTP id 13mr4805507wfm.127.1225384792294; Thu, 30 Oct 2008 09:39:52 -0700 (PDT) Received: from david-home.localnet ([203.94.189.86]) by mx.google.com with ESMTPS id 31sm3139483wff.16.2008.10.30.09.39.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Oct 2008 09:39:51 -0700 (PDT) To: bug-gnu-emacs@gnu.org, jasonspiro4@gmail.com Subject: color output from external programs not working by default in eshell Date: Fri, 31 Oct 2008 02:39:44 +1000 User-Agent: KMail/1.10.1 (Linux/2.6.27-ARCH; KDE/4.1.2; i686; ; ) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary-00=_QNeCJjkcm/rkCQF" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810310239.44166.davidmiani@gmail.com> From: David Miani X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --Boundary-00=_QNeCJjkcm/rkCQF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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'' --Boundary-00=_QNeCJjkcm/rkCQF Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit

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''

--Boundary-00=_QNeCJjkcm/rkCQF-- From monnier@iro.umontreal.ca Thu Oct 30 20:36:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.3 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 31 Oct 2008 03:36:33 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9V3aTQr010036 for ; Thu, 30 Oct 2008 20:36:30 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvkoG-0007gP-RF for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 23:36:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvkoF-0007fm-EJ for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 23:36:28 -0400 Received: from [199.232.76.173] (port=56945 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvkoF-0007fR-6r for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 23:36:27 -0400 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:54051 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KvkoF-0008W3-30 for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 23:36:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsAEAHcaCklMCqyo/2dsb2JhbACBdslhg1GBDg X-IronPort-AV: E=Sophos;i="4.33,519,1220241600"; d="scan'208";a="29113168" Received: from 76-10-172-168.dsl.teksavvy.com (HELO pastel.home) ([76.10.172.168]) by ironport2-out.teksavvy.com with ESMTP; 30 Oct 2008 23:36:24 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9CFA58E73; Thu, 30 Oct 2008 23:36:24 -0400 (EDT) From: Stefan Monnier To: David Miani Cc: 1279@debbugs.gnu.org, bug-gnu-emacs@gnu.org, jasonspiro4@gmail.com Subject: Re: bug#1279: color output from external programs not working by default in eshell Message-ID: References: <200810310239.44166.davidmiani@gmail.com> Date: Thu, 30 Oct 2008 23:36:24 -0400 In-Reply-To: <200810310239.44166.davidmiani@gmail.com> (David Miani's message of "Fri, 31 Oct 2008 02:39:44 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > 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 From davidmiani@gmail.com Fri Oct 31 19:28:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.4 required=4.0 tests=BAYES_00,FOURLA, HAS_BUG_NUMBER,HTML_MESSAGE autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1279) by emacsbugs.donarmstrong.com; 1 Nov 2008 02:28:01 +0000 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.173]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA12Rwts031796 for <1279@emacsbugs.donarmstrong.com>; Fri, 31 Oct 2008 19:27:59 -0700 Received: by wf-out-1314.google.com with SMTP id 26so1712588wfd.13 for <1279@emacsbugs.donarmstrong.com>; Fri, 31 Oct 2008 19:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:reply-to:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id:from; bh=njTYrxZuEIkM7y3ED2klm4PDml8skSK92Rh7u11j0qY=; b=rX0T+xe0+ezpnoFLIX1/iaJTjuDlwXOx1B9AdSoDzZLMlaAQK62HIgQZwcA0WbyCIN Y/sfpVmjXjngnT9/YIVwXUH+ECmLTX2w8tcBRsD3hdW7hNRlswQpHQ9J6NB2Aa5r4whN Q+UYX3/Db2kjVYcFBf3uGbx/1iCcOsxHm76NI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id:from; b=JaEmdAPImJh85rMo0SRYl8Inx80hxTtosX0pQ98RleIxhoxzxitOuS5T+d8JZER4c4 UC2/PnoG1jC4T0/KYz1OWIwGloJ+HzUGWBAuzdY8U3K+0TUrZGzZRASKIKtt5GbyNLDg 3MDrXwbgj62ft/+d/KbpWloqpg0Nxou4FaI0o= Received: by 10.142.177.7 with SMTP id z7mr5103937wfe.249.1225506478029; Fri, 31 Oct 2008 19:27:58 -0700 (PDT) Received: from david-home.localnet ([203.94.189.86]) by mx.google.com with ESMTPS id 32sm7382116wfa.8.2008.10.31.19.27.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Oct 2008 19:27:56 -0700 (PDT) Reply-To: nanothief@gmail.com To: 1279@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 User-Agent: KMail/1.10.1 (Linux/2.6.27-ARCH; KDE/4.1.2; i686; ; ) References: <200810310239.44166.davidmiani@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary-00=_D67CJTC1+CO1FGv" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811011227.15929.nanothief@gmail.com> From: nanothief --Boundary-00=_D67CJTC1+CO1FGv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > What does $TERM say in your shell? =A0Is this terminal type known to > support color? =A0If 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 erro= r=20 message "tput: No value for $TERM and no -T specified". Running the command= =20 export TERM=3D"dumb" stops the error messages, but the program still output= s in=20 color. Note that the program probably doesn't work correctly with a non-color shel= l,=20 as it is meant as an advancement on another program, so it is unlikely the= =20 developers tested it with a non-color term.=20 However, I'm not sure how relevant this is to this bug, as if eshell can be= =20 made to work easily with color, then why not set it as default? --Boundary-00=_D67CJTC1+CO1FGv Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

> What d= oes $TERM say in your shell? =A0Is this terminal type known to

> suppor= t color? =A0If 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 runnin= g 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 T= ERM=3D"dumb" stops the error messages, but the program still outputs in col= or.

Note that t= he 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 develope= rs 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 wo= rk easily with color, then why not set it as default?

--Boundary-00=_D67CJTC1+CO1FGv-- From cyd@stupidchicken.com Wed Jan 21 20:46:36 2009 Received: (at 1279-done) by emacsbugs.donarmstrong.com; 22 Jan 2009 04:46:36 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0M4kT0R019598 for <1279-done@emacsbugs.donarmstrong.com>; Wed, 21 Jan 2009 20:46:30 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 9138257E225; Wed, 21 Jan 2009 23:46:53 -0500 (EST) From: Chong Yidong To: 1279-done@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 Message-ID: <877i4ovtfm.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii The 2009-01-21 checkin by John Wiegley fixes this. From unknown Sat Jun 21 04:58:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Thu, 19 Feb 2009 15:24:05 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator