From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#45380: 28.0.50; Error in coloured output in Emacs 28.05(AUR package: emacs-git) Date: Sun, 24 Jan 2021 00:09:34 +0100 Message-ID: <87zh0zqmhd.fsf@gnus.org> References: <87o8il9n8q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31141"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45380@debbugs.gnu.org To: Utkarsh Singh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 24 00:10:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3S2k-0007xi-UE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jan 2021 00:10:10 +0100 Original-Received: from localhost ([::1]:58074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3S2j-0000HP-Fs for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 18:10:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3S2c-0000H2-MQ for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 18:10:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3S2c-00044l-F8 for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 18:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3S2c-0004II-7O for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 18:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2021 23:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45380 X-GNU-PR-Package: emacs Original-Received: via spool by 45380-submit@debbugs.gnu.org id=B45380.161144338716478 (code B ref 45380); Sat, 23 Jan 2021 23:10:02 +0000 Original-Received: (at 45380) by debbugs.gnu.org; 23 Jan 2021 23:09:47 +0000 Original-Received: from localhost ([127.0.0.1]:35577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3S2N-0004Hh-9P for submit@debbugs.gnu.org; Sat, 23 Jan 2021 18:09:47 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:56972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3S2K-0004HS-NW for 45380@debbugs.gnu.org; Sat, 23 Jan 2021 18:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RTDbNw7CLWfDXUVB0SQhFxxMxq/Vmz1otQcIsEb3TUY=; b=OztNOzURvaUpkacoksI3mYDfvM Fn1zqVatQpFeUpxy+aPWlEG7Q1aNKTKSIMWGTfgreEk2y0sBlPDoqT/vAfGv79oKm1nOxDEgcr9B3 /sBvb6qjqJDaRxxIY8z9XlQdxe4ugCw6ubJfIdCLOw7to8kPE5eGBZRSffAajqqpINE8=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3S2B-0006Zk-Fg; Sun, 24 Jan 2021 00:09:38 +0100 X-Now-Playing: Arthur Russell's _Sketches For World Of Echo (June 25 1984 Live At Ei)_: "The Boy With A Smile On His Face (Live 6-24-84)" In-Reply-To: <87o8il9n8q.fsf@gmail.com> (Utkarsh Singh's message of "Wed, 23 Dec 2020 09:39:57 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198482 Archived-At: Utkarsh Singh writes: > In the attached screenshot I am trying to compare eshell behaviour > for 2 colored outputs. On the left hand side 'pacman -Ss emacs' command > generates a small coloured output which works as expected but on the > right hand side 'yay -Ss emacs' generates a fairly large output in which > half of the colour in distorted. Screenshot have been obtained using > 'emacs -Q' command. I've seen similar bug reports about Emacs losing track of ANSI highlighting -- especially when using programs like pacman, but I've so far not been able to track down when/why this happens. My theory is that the ansi-color-apply-on-region state machine somehow becomes confused. If this is repeatable to you, could you apply the following patch to record the data, and then go to some buffer, M-: (pp my-replay (current-buffer)) write the buffer to a file, gzip it, and then send it as an attachment to this debbugs address? diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index e5bfccdb8b..e1fcd3d2ce 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -363,6 +363,8 @@ ansi-color-filter-region (setq ansi-color-context-region (list nil (match-beginning 0))) (setq ansi-color-context-region nil))))) +(defvar my-replay nil) + (defun ansi-color-apply-on-region (begin end &optional preserve-sequences) "Translates SGR control sequences into overlays or extents. Delete all other control sequences without processing them. @@ -384,6 +386,7 @@ ansi-color-apply-on-region If PRESERVE-SEQUENCES is t, the sequences are hidden instead of being deleted." + (push (buffer-substring begin end) my-replay) (let ((codes (car ansi-color-context-region)) (start-marker (or (cadr ansi-color-context-region) (copy-marker begin))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no