From unknown Thu Jun 19 14:09:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31071 <31071@debbugs.gnu.org> To: bug#31071 <31071@debbugs.gnu.org> Subject: Status: Previous color lost when using --color=always option Reply-To: bug#31071 <31071@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:09:23 +0000 retitle 31071 Previous color lost when using --color=3Dalways option reassign 31071 grep submitter 31071 Adrian H severity 31071 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 05 17:31:23 2018 Received: (at submit) by debbugs.gnu.org; 5 Apr 2018 21:31:24 +0000 Received: from localhost ([127.0.0.1]:39698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4CTb-0005Op-KW for submit@debbugs.gnu.org; Thu, 05 Apr 2018 17:31:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4807-0007Kx-NG for submit@debbugs.gnu.org; Thu, 05 Apr 2018 12:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4801-0005pv-LE for submit@debbugs.gnu.org; Thu, 05 Apr 2018 12:44:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4801-0005pp-I7 for submit@debbugs.gnu.org; Thu, 05 Apr 2018 12:44:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4800-00054T-Jf for bug-grep@gnu.org; Thu, 05 Apr 2018 12:44:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f47zz-0005pA-Nx for bug-grep@gnu.org; Thu, 05 Apr 2018 12:44:32 -0400 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]:44836) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f47zz-0005ot-HS for bug-grep@gnu.org; Thu, 05 Apr 2018 12:44:31 -0400 Received: by mail-wr0-x232.google.com with SMTP id u46so29522901wrc.11 for ; Thu, 05 Apr 2018 09:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=Nx+S48n6tFY9pcD9W8tIlJ+z7sS3aTJe8amw3EwxQts=; b=fucg8RkvCK2a+C8qEZoo0pO7OIWUdo9q+HSZSO7nSq0oVMXP2VL/Llcb/9FCANnhlo 7dw5M7HifoMMcmYs1Ww/rpct2SMYU21vlDTdESDTcNHJFLEoz0HgEI0MNfcmPSTyrftu nH7MxvW6vB3Sx7bTH17cozIhF+7cQUxH6QZb6Jj2LEOAMdSTOrESMJU+GAPlDeIGmrYR 1ss1oINPu4iANZTWh+MpeGREsrKV+8oGA9tJGdTHsB5s0gvFiBe8Z2gpdjWXoZKTY1rS HQg9sR50dO2exu4+oLiZea8xSxtJ9B0LFftkxN4FTwb4f1YaFMBdayVa9DRFoOZ7iRQo 4soQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=Nx+S48n6tFY9pcD9W8tIlJ+z7sS3aTJe8amw3EwxQts=; b=Y87km/lwKoJalXi1IsRORlaGnO4NdusBuimvISdULwIJb3icCrEUBiCHrCZtUqigM+ UaB42MCHbQbq55EQhieGNkuv56YrfmtNus7pd6L2iyktaimmd4Pe9SjraMjKQTkTit2p +3BYs+9bjLFVyOeVIMOOtdqnybBEwdncKAz8bte04kRhtyMdYw07cyuqhBYD8ZkayyD0 vcy9GQsPmLWcSzB9L8lCQYQioOMGwgEtFu8PhNIPz5iQqv2h+8zLvvMpEWI27+kCi+9x WXeo+Uvg90hqddmgVisotBllbZSrbe6S1+reLD55+kx7mxP2U+0kTV95jO+FArpZQeca rINQ== X-Gm-Message-State: ALQs6tD0IGUYLJMAYW3gRhnfRx4AhirbBc7SUBMPw936A81BveSI1rj0 D+RTK9rc3JniwHJHCg8QND4bjZft3Cu63HhVCdtUhw== X-Google-Smtp-Source: AIpwx4+5HSys7eOTpdn0RWN/uIBcFCfWVj53x5CjKLdSq3Ut36YocXl7hgX+ptTitRnhf1Uvzr8jO+1Kpq5Br7AF3uI= X-Received: by 2002:a19:c1c8:: with SMTP id r191-v6mr13360896lff.45.1522946669760; Thu, 05 Apr 2018 09:44:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.179.88.133 with HTTP; Thu, 5 Apr 2018 09:44:29 -0700 (PDT) From: Adrian H Date: Thu, 5 Apr 2018 12:44:29 -0400 X-Google-Sender-Auth: 4dJyPfNyLD7wlqFCTSiw54TcEkc Message-ID: Subject: Previous color lost when using --color=always option To: bug-grep@gnu.org Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 05 Apr 2018 17:31:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) If I use grep --color=always and it matches on a line that is already coloured, it results in the text after the match is reset to the terminal's default colour/attributes. E.g. This just shows a line with some colour/attributes set: $ echo The quick brown fox jumps over the lazy dog | > GREP_COLOR='03;36' grep --color=always '.*' ESC[03;36mESC[KThe quick brown fox jumps over the lazy dogESC[mESC[K This shows the same line with fox highlighted in other attributes: $ echo The quick brown fox jumps over the lazy dog | > GREP_COLOR='03;36' grep --color=always '.*' | > GREP_COLOR='01;36' grep --color=always 'fox' ESC[03;36mESC[KThe quick brown ESC[01;36mESC[KfoxESC[mESC[K jumps over the lazy dogESC[mESC[K The issue is that the current colour isn't tracked, it is just reset with ESC[m. It would be nice if it were able to be tracked. Yes, it is more difficult to code, but I think it would be useful when highlighting a coloured textual document. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 01 02:37:18 2020 Received: (at control) by debbugs.gnu.org; 1 Jan 2020 07:37:18 +0000 Received: from localhost ([127.0.0.1]:35563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imYZC-0006Ee-4i for submit@debbugs.gnu.org; Wed, 01 Jan 2020 02:37:18 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imYZB-0006ET-1p for control@debbugs.gnu.org; Wed, 01 Jan 2020 02:37:17 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AB1BB16008F for ; Tue, 31 Dec 2019 23:37:11 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PwfeHVNC3A9v for ; Tue, 31 Dec 2019 23:37:11 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1EBA116022A for ; Tue, 31 Dec 2019 23:37:11 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4ogbINDYPaNn for ; Tue, 31 Dec 2019 23:37:11 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F394D16008F for ; Tue, 31 Dec 2019 23:37:10 -0800 (PST) To: control@debbugs.gnu.org From: Paul Eggert Subject: 31071 is wishlist Organization: UCLA Computer Science Department Message-ID: <34ab972e-83fc-d700-69f0-6429aff215a4@cs.ucla.edu> Date: Tue, 31 Dec 2019 23:37:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 31071 wishlist