GNU bug report logs - #6085
Eshell doesn't handle ANSI escapes/colors well

Previous Next

Package: emacs;

Reported by: Ken Hori <fplemma <at> gmail.com>

Date: Mon, 3 May 2010 03:55:02 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 6085 in the body.
You can then email your comments to 6085 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6085; Package emacs. (Mon, 03 May 2010 03:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Hori <fplemma <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 03 May 2010 03:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Hori <fplemma <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Eshell doesn't handle ANSI escapes/colors well
Date: Sun, 2 May 2010 20:54:46 -0700
From Emacs bzr HEAD:

Eshell doesn't handle a terminal escape code like ^[.

My eshell-output-filter-functions:
 '(eshell-output-filter-functions (quote (eshell-handle-ansi-color
eshell-handle-control-codes eshell-watch-for-password-prompt
eshell-postoutput-scroll-to-bottom)))

Example:
[~/emacs.20100501/lisp/eshell]$ export TERM=xterm-256color
[~/emacs.20100501/lisp/eshell]$ *grep --color=auto ansi esh-*
^[[Kesh-mode.el^[[K^[[K:^[[K    eshell-handle-^[[Kansi^[[K-color
^[[Kesh-mode.el^[[K^[[K:^[[K(autoload
'^[[Kansi^[[K-color-apply-on-region "^[[Kansi^[[K-color")
^[[Kesh-mode.el^[[K^[[K:^[[K(defun eshell-handle-^[[Kansi^[[K-color ()
^[[Kesh-mode.el^[[K^[[K:^[[K  (^[[Kansi^[[K-color-apply-on-region
eshell-last-output-start
^[[Kesh-mode.el^[[K^[[K:^[[K		   'eshell-handle-^[[Kansi^[[K-color)
^[[Kesh-var.el^[[K^[[K:^[[K;; is identical to just saying (lisp); but
with the variable exp^[[Kansi^[[Kon


`term-handle-ansi-escape' from term.el seems to be be handling
ansi escapes very well. Maybe we can integrate  a modified
version of it into Eshell.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6085; Package emacs. (Mon, 03 May 2010 05:42:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#6085: Eshell doesn't handle ANSI escapes/colors well
Date: Mon, 03 May 2010 07:37:31 +0200
Ken Hori <fplemma <at> gmail.com> writes:

> From Emacs bzr HEAD:
>
> Eshell doesn't handle a terminal escape code like ^[.
>
> My eshell-output-filter-functions:
>  '(eshell-output-filter-functions (quote (eshell-handle-ansi-color
> eshell-handle-control-codes eshell-watch-for-password-prompt
> eshell-postoutput-scroll-to-bottom)))
>
> Example:
> [~/emacs.20100501/lisp/eshell]$ export TERM=xterm-256color
> [~/emacs.20100501/lisp/eshell]$ *grep --color=auto ansi esh-*
> ^[[Kesh-mode.el^[[K^[[K:^[[K    eshell-handle-^[[Kansi^[[K-color
> ^[[Kesh-mode.el^[[K^[[K:^[[K(autoload
> '^[[Kansi^[[K-color-apply-on-region "^[[Kansi^[[K-color")
> ^[[Kesh-mode.el^[[K^[[K:^[[K(defun eshell-handle-^[[Kansi^[[K-color ()
> ^[[Kesh-mode.el^[[K^[[K:^[[K  (^[[Kansi^[[K-color-apply-on-region
> eshell-last-output-start
> ^[[Kesh-mode.el^[[K^[[K:^[[K		   'eshell-handle-^[[Kansi^[[K-color)
> ^[[Kesh-var.el^[[K^[[K:^[[K;; is identical to just saying (lisp); but
> with the variable exp^[[Kansi^[[Kon
>
>
> `term-handle-ansi-escape' from term.el seems to be be handling
> ansi escapes very well. Maybe we can integrate  a modified
> version of it into Eshell.

This was working some time ago so maybe looking at what have changed and
reenable this feature should be good.

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/






Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Sat, 29 May 2010 18:30:03 GMT) Full text and rfc822 format available.

Notification sent to Ken Hori <fplemma <at> gmail.com>:
bug acknowledged by developer. (Sat, 29 May 2010 18:30:03 GMT) Full text and rfc822 format available.

Message #13 received at 6085-done <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: Ken Hori <fplemma <at> gmail.com>, 6085-done <at> debbugs.gnu.org
Subject: Re: Eshell doesn't handle ANSI escapes/colors well
Date: Sat, 29 May 2010 14:29:22 -0400
>> Eshell doesn't handle a terminal escape code like ^[.
>>
>> [~/emacs.20100501/lisp/eshell]$ export TERM=xterm-256color
>> [~/emacs.20100501/lisp/eshell]$ *grep --color=auto ansi esh-*
>> ^[[Kesh-mode.el^[[K^[[K:^[[K    eshell-handle-^[[Kansi^[[K-color
>
> This was working some time ago so maybe looking at what have changed and
> reenable this feature should be good.

No, this is not a regression.  The mess here is due to the ^[[K ("erase
line") sequence that colorized grep emits.  (I don't know why it needs
this control sequence.)

There is no sane way for the ansi-color package to handle this.  Unlike
term.el, it is not intended to be a terminal emulator.  The best we can
do is to delete such sequences from the output, and I've committed a
change to do that.




Message #14 received at 6085-done <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Ken Hori <fplemma <at> gmail.com>, 6085-done <at> debbugs.gnu.org
Subject: Re: Eshell doesn't handle ANSI escapes/colors well
Date: Sat, 29 May 2010 20:58:41 +0200
Chong Yidong <cyd <at> stupidchicken.com> writes:

>>> Eshell doesn't handle a terminal escape code like ^[.
>>>
>>> [~/emacs.20100501/lisp/eshell]$ export TERM=xterm-256color
>>> [~/emacs.20100501/lisp/eshell]$ *grep --color=auto ansi esh-*
>>> ^[[Kesh-mode.el^[[K^[[K:^[[K    eshell-handle-^[[Kansi^[[K-color
>>
>> This was working some time ago so maybe looking at what have changed and
>> reenable this feature should be good.
>
> No, this is not a regression.  The mess here is due to the ^[[K ("erase
> line") sequence that colorized grep emits.  (I don't know why it needs
> this control sequence.)
>
> There is no sane way for the ansi-color package to handle this.  Unlike
> term.el, it is not intended to be a terminal emulator.  The best we can
> do is to delete such sequences from the output, and I've committed a
> change to do that.

Yes, agree, i have already changed eshell for term for the emerge
command in anything-gentoo.

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Jun 2010 11:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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