From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#12792: 24.2.50; shell-mode renders all its output in a yellow face Date: Mon, 5 Nov 2012 15:57:11 -0800 Message-ID: <20121105155711.267e869b@fatty> References: <871ugbxdyr.fsf@secretsauce.net> <85r4oazoh4.fsf@iznogoud.viz> <83y5ii4pfw.fsf@gnu.org> <85d2zuzhxe.fsf@iznogoud.viz> <85hap6yre0.fsf@iznogoud.viz> <20121104004557.00fb50a5@shorty.local> <85txt5eav5.fsf@iznogoud.viz> <20121104122456.3f2c6448@shorty.local> <85sj8prl8d.fsf@iznogoud.viz> <20121104192343.1f243455@shorty.local> <854nl4krvr.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352159941 29919 80.91.229.3 (5 Nov 2012 23:59:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 23:59:01 +0000 (UTC) Cc: 12792@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 00:59:10 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TVWZR-0006Eq-Us for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2012 00:59:10 +0100 Original-Received: from localhost ([::1]:37044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVWZJ-0001qI-7i for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 18:59:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVWZF-0001qB-6N for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 18:58:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVWZD-0003Qa-6g for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 18:58:57 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVWZC-0003QL-Ve for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 18:58:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TVWcE-0001IK-Fm for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 19:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Nov 2012 00:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12792 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12792-submit@debbugs.gnu.org id=B12792.13521600974942 (code B ref 12792); Tue, 06 Nov 2012 00:02:02 +0000 Original-Received: (at 12792) by debbugs.gnu.org; 6 Nov 2012 00:01:37 +0000 Original-Received: from localhost ([127.0.0.1]:51272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVWbo-0001Hd-Cd for submit@debbugs.gnu.org; Mon, 05 Nov 2012 19:01:37 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:33710) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVWbk-0001HT-I0 for 12792@debbugs.gnu.org; Mon, 05 Nov 2012 19:01:34 -0500 Original-Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 690F920531; Mon, 5 Nov 2012 18:58:24 -0500 (EST) Original-Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute6.internal (MEProxy); Mon, 05 Nov 2012 18:58:24 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=Ll9pCLZm8KHI+2UYdRE/0Mjrdp4=; b=aSNNpqd1aqKYKa57KGdfLLycjw1G gfpDxKzw2Bbqed/xjSK+m+pkPPkQXgyCSOF4ZGsHAd1Xp2/jBYjs2eD/59Cg7vWA l5DYs6ErT9Dxyv8UIjaNLC+kSsofr1qexUylwWd6iZG77iA76Uj4N9Co9lQVvFby JwWGP0HDQKF5vDw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=smtpout; bh=Ll9pCLZm8KHI+2UYdRE/0M jrdp4=; b=KZF3qam51cmtmwrSfBBuK5+FQ79sjXtPbB1JhE+6I/kIFFsKwypPBs VDbgakPv1uJ6iqeCgUcvKQhqt9TWf+mdoIxauWDto8AM+IwKaJJ/oXXdriXR4lAw zXVNFP3BdjqSkkzuPG5bOrlOmNcB2+BW3hhIZuyQTyFzF+RGHQaDw= X-Sasl-enc: VV03rCAykNwlBV/HOkEPT+wy5ja+/7MvaQQ5rfk9xNIV 1352159903 Original-Received: from fatty (unknown [204.154.109.20]) by mail.messagingengine.com (Postfix) with ESMTPA id C22A78E04E0; Mon, 5 Nov 2012 18:58:23 -0500 (EST) In-Reply-To: <854nl4krvr.fsf@iznogoud.viz> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66510 Archived-At: > On Mon, 05 Nov 2012 16:00:34 +0100 > Wolfgang Jenkner wrote: > > 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 ansi-color-apply-sequence > M-x trace-function-background > comint-output-filter > > 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 > > > > Hi Wolfgang. I just ran those tests. Previously, I would do M-x shell, and then evaluate the new defun; this produced the results I described earlier. You just asked for a different order: load ansi-color, comint, THEN eval defun, THEN M-x shell. That produces different colored results: everything looks correct except the prompt is all blue all the time. Nothing has nil face. Is this the expected behavior with that defun, or is the prompt supposed to look right also? The trace output follows. Note that once again I replaced all escape characters with '\e'. ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="1 2 3 4 " 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="5 \e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="drwxr-xr-x 4 dima dima 4096 Nov 5 00:33 \e[0m\e[01;34m/home/dima/.emacs.d\e[0m " | 2 -> ansi-color-apply-sequence: escape-sequence=#("0m" 0 2 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("01;34m" 0 6 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (34 1) | 2 -> ansi-color-apply-sequence: escape-sequence=#("0m" 0 2 (fontified nil)) codes=(34 1) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="\e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="1 2 3 4 " 1 <- comint-output-filter: # ====================================================================== 1 -> comint-output-filter: process=# string="5 \e[32mdima@fatty\e[39m:\e[33m/tmp\e[39m$ " | 2 -> ansi-color-apply-sequence: escape-sequence=#("32m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (32) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(32) | 2 <- ansi-color-apply-sequence: nil | 2 -> ansi-color-apply-sequence: escape-sequence=#("33m" 0 3 (fontified nil)) codes=nil | 2 <- ansi-color-apply-sequence: (33) | 2 -> ansi-color-apply-sequence: escape-sequence=#("39m" 0 3 (fontified nil)) codes=(33) | 2 <- ansi-color-apply-sequence: nil 1 <- comint-output-filter: #