coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Would a patch adding color to cat(1) be accepted?


From: Eric Pruitt
Subject: Re: Would a patch adding color to cat(1) be accepted?
Date: Sun, 22 Dec 2019 21:46:55 -0800
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Oct 10, 2017 at 08:37:24AM -0500, Eric Blake wrote:
> On 10/10/2017 03:43 AM, Pádraig Brady wrote:
> > This idea has some merit, though I'd prefer not to have
> > cat needing to deal with CAT_COLORS etc.
>
> I also like the idea, but detest the environment variable.  When we
> recently added coloring to 'diff' (see diffutils 3.4), we chose --color
> to turn things on, but --palette to specify which colors to use rather
> than an environment variable.
>
> In fact, if we want to add 'cat --palette', it might be nice to retrofit
> 'ls --color --palette' where the command line takes precedence over the
> environment variable LS_COLORS.

I finally implemented a version of this (patch attached). The
implementation uses hard-coded sequences for making text bold and also
for sgr0. I would be willing to modify the patch to make it more
flexible by implementing a "--palette" option as suggested and renaming
the option to something like "--highlight-escapes" or "--color-escapes".
Since I don't personally need that flexibility, I wanted to follow-up to
see if the change would be accepted upstream so I don't make the changes
for naught.

Eric

Attachment: coreutils-8.31-bold-escapes.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]