Subject: bug#12792: 24.2.50; shell-mode renders all its output in a yellow face

From: Wolfgang Jenkner <[email-masked]>
Date: Mon, 05 Nov 2012 16:00:34 +0100

On Mon, Nov 05 2012, Dima Kogan wrote:

> The output (with all the 'escape' characters replaced with '\e' to make sure the
> email handlers don't get confused):
>
>
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ 
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ 
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ seq 5
> 1
> 2
> 3
> 4
> 5
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ ls --color=auto -ld .emacs.d
> drwxr-xr-x 6 dima dima 4096 Nov  3 15:31 \e[0m\e[01;34m.emacs.d\e[0m
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ seq 5
> 1
> 2
> 3
> 4
> 5
> \e[31mdima@shorty\e[39m:\e[33m~\e[39m$ 
>
>
[...]
> If I evaluate your defun also, I get everything red (nil face also) until the
> ".emacs.d". The ".emacs.d" is blue, as it should be. From that point on, all the
> plain output is black and all the prompts are blue. This is correct, except the
> prompts still shouldn't be all blue.

Thanks for the precise recipe.  I installed zsh 5.0.0 from ports in
FreeBSD 9 and tried it, but I can't reproduce the bogus red colouring
(with the rewritten ansi-color-apply-sequence).

So I would like to ask you to do some more investigation:

As usual, load ansi-color and then eval the new definition of
ansi-color-apply-sequence.

Then

M-x trace-function-background <return> ansi-color-apply-sequence <return> <return>
M-x trace-function-background <return> comint-output-filter <return> <return>

M-x shell and type in the same shell commands as above.

M-x untrace-all

Then please attach the content of "*trace-output*" to your reply.

Wolfgang