From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45380: 28.0.50; Error in coloured output in Emacs 28.05(AUR package: emacs-git) Date: Mon, 25 Oct 2021 14:27:15 +0200 Message-ID: <87cznte1cs.fsf@miha-pc> References: <87o8il9n8q.fsf@gmail.com> <87zh0zqmhd.fsf@gnus.org> <877do2n3ux.fsf@gmail.com> <87y2ggoa22.fsf@gnus.org> <87lf2i0w0l.fsf@gnus.org> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37093"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Utkarsh Singh , 45380@debbugs.gnu.org To: Morgan Smith , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 25 14:27:58 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 1mez53-0009PR-HX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 14:27:58 +0200 Original-Received: from localhost ([::1]:47036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mez52-00051p-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 08:27:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mez1G-0000mp-Jt for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 08:24:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mez1G-00046n-9a for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 08:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mez1G-0006c3-2Y for bug-gnu-emacs@gnu.org; Mon, 25 Oct 2021 08:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Oct 2021 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 45380-submit@debbugs.gnu.org id=B45380.163516460225362 (code B ref 45380); Mon, 25 Oct 2021 12:24:02 +0000 Original-Received: (at 45380) by debbugs.gnu.org; 25 Oct 2021 12:23:22 +0000 Original-Received: from localhost ([127.0.0.1]:41826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mez0b-0006ay-Mr for submit@debbugs.gnu.org; Mon, 25 Oct 2021 08:23:22 -0400 Original-Received: from kamnitnik.top ([209.250.245.214]:36414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mez0Y-0006am-Ni for 45380@debbugs.gnu.org; Mon, 25 Oct 2021 08:23:19 -0400 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id 468B99CFAB; Mon, 25 Oct 2021 12:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1635164597; bh=VvDZ3YNZMsbuFUhEcDrdVNk1tMDcEPc1i/1bs2UNjOM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AJMMdxmTwbVo6gAMFdg3sBxa+ckH18aghcpMVtqMtmJCCoL66qRsnOctM6DB9140G PQQNqH0HvAxANYTNBuj2R0De1BUtnNLp86WLievPpv3P8y/+cIhz2jCxXKMkl7t6gD CamaI1yZixO3aICEjlO4nXRoNKRwrKdCixwGYj0Dksn3a+xf83zJNlaZQ2nrD+titR qxutO8DRjZd8dQU3hP+h1j1t3lJ1I5l1+vRs7WmeaHTnvYmRCiIkH62GjhW8O4rMum H2dPAYqmdH1pHt4yafWzZQKo+saqsxlsSYH41Y+rYFGFk5eh0a2ybWG1ba4E+3fDjv CXLHZjI7o1BLQ== In-Reply-To: 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:218263 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Morgan Smith writes: > Ya I sent a bug report (46332) about this exact same thing happening.=20 > And then you fixed it so that it happened much less often. I didn't=20 > notice until like a day after we closed that issue. My guess is that=20 > there are two unrelated bugs that exhibit the exact same behavior and=20 > you already fixed one. I read that bug report and looked into this. As you said, there were two bugs exhibiting similar behaviour. One was in ansi-color, fixed by Lars in that bug report. The other bug, not yet fixed, is with esh-mode.el. It uses 'insert-before-markers' to insert process output, pushing forward the marker used by ansi-color. A reliable reproducer is to open eshell and execute sh -c "printf 'NORMAL \033[32m'; sleep 1; printf 'GREEN \033[m\n'" Please find the attached patch which fixes this. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Avoid-insert-before-markers-in-eshell.patch Content-Transfer-Encoding: quoted-printable From=203cda385ffd292ade869abf7e39cbb45ca10349fb Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Mon, 25 Oct 2021 14:09:30 +0200 Subject: [PATCH] Avoid insert-before-markers in eshell * lisp/eshell/esh-mode.el (eshell-mode): Make window point advance on insertion. (eshell-output-filter): Don't use insert-before-markers. =2D-- lisp/eshell/esh-mode.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 579b01f4d1..2b5a4647e0 100644 =2D-- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -315,6 +315,8 @@ eshell-mode (setq-local bookmark-make-record-function #'eshell-bookmark-make-record) (setq local-abbrev-table eshell-mode-abbrev-table) =20 + (setq-local window-point-insertion-type t) + (setq-local list-buffers-directory (expand-file-name default-directory)) =20 ;; always set the tab width to 8 in Eshell buffers, since external @@ -696,13 +698,10 @@ eshell-output-filter (setq oend (+ oend nchars))) ;; Let the ansi-color overlay hooks run. (let ((inhibit-modification-hooks nil)) =2D (insert-before-markers string)) + (insert string)) (if (=3D (window-start) (point)) (set-window-start (selected-window) (- (point) nchars))) =2D (if (=3D (point) eshell-last-input-end) =2D (set-marker eshell-last-input-end =2D (- eshell-last-input-end nchars))) (set-marker eshell-last-output-start ostart) (set-marker eshell-last-output-end (point)) (force-mode-line-update)) =2D-=20 2.33.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmF2oqMTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP7lrD/sHyY0UGCvm/LyvhDQgY9UDcvcv/hp1 6oQ4JYXdzo5yAvlpuAlUN7xMnljdqcC0PzgBz+4xXrunJkzWFJY4yO02gfp3kYD4 ljLWQclM1QWnQgjdY7r+DxY1EQ/NdYGnxYQYx0he4pEuwV3w35xbB5cHpO/F2LC2 1oYDra54Uh/Sq258Y04kL2KXIUvGeoUvZwyaJzeFw4kbRsGwsvLhUsMYXXwfbts6 Au452130cxItLGy1+iEnSEOHBPxNoZzaDke+aKgIyrL+TUg9+NLtBh2f7/hQqKrk 8KPQXQaljAwnnmcLlpclPM+9YlPlWc2KiFdFFevwtIbG/hseVzJ4TSX1greOwk6E +PZKNu31XHSP789oFtetAusW3FL2srf96sWv/NDJqcHkclMGim3jaNUmK19JBt4x l4Xck76NDVpzyX0MpZjXMLXHvdEotP7X9IMV9X427diiVEh4VafQfjatnl5EUwiF 74NxuRw+sK7GZcjr0Hue/J/aqq83pfGAVBMtQp+MViJm+8h2yCuxMI4WxmOhj0wM os8FWfpSZP2MuzN0nBzX6+ispAz8dpdBZB5LICCt/sS5de+eHjzDbZS7X2y8kIsV 5dgQh4mit8K2x3IAaWbkiTQPscehGpwN3XdRLFnXrhYxCyWmr8lm346DcaQYunRW 28o645AxSVWPZQ== =3bUt -----END PGP SIGNATURE----- --==-=-=--