#111013 [patch] color output

Package:
apt-listchanges
Source:
apt-listchanges
Submitter:
Andras BALI
Date:
2021-08-09 07:12:04 UTC
Severity:
wishlist
Tags:
#111013#5
Date:
2001-09-02 22:03:07 UTC
From:
To:
Hi Matt,

I played around a bit with apt-listchanges and found that it'd be
really cool to have the output colorized. I wrote a small and simple
patch to do the job using regexps, it worked reasonably well on the
files I tried.

The patch enables color mode to the text and pager frontends, but note
that not all pagers support displaying raw control codes. In fact, I
found that `less' needs the `-r' or the `-R' switch, but `most' and
`more' don't support them in any ways. This situation could be handled
eg. by using a special configuration variable "pageropt", which would
hold a string that'd be passed to the pager at the invocation time,
but I haven't implemented it yet, as your opinione may vary.
Unfortunately it means that only `less' can be used as pager for color
output. Text output works without any such flaws if the terminal
supports ANSI color codes.

I haven't tested this whole thing with the xterm-pager frontend but I
assume that it works with the same conditions as the console pager.

I also updated the manual a bit, <option></option>-s were missing at a
few places and I documented the new feature added by this patch as well.

Please make permissions and owners in the upstream tarball a bit more
standard, if possible.

Regards,

#111013#10
Date:
2001-09-08 17:29:52 UTC
From:
To:
This sounds interesting, though I haven't tried it yet.  The problem with
pager interaction is discouraging, as pager seems to be the most popular
frontend at the moment.  Most users probably don't want to have 'less' use
the -r or -R option by default, but only with apt-listchanges.  This means
that we could no longer use sensible-pager, and would have to invent a
secondary mechanism for specifying the pager program.

It would be great if your patch could use the terminfo database to get the
escape codes, rather than hard-coding them, so that it could correctly
support any terminal type.

Another option might be to use an HTML output frontend to do colorization
and hyperlinks (see wishlist bug #82360).  Then you wouldn't have to worry
about any of this.

It does.

Thanks for taking the time to document your changes.

Are you referring to group writability?  That is the default on many Debian
systems, and you'll find that it's not unusual in source tarballs if you
browse through the Debian archive.

The same goes for the ownership (mdz/mdz).

#111013#15
Date:
2001-09-09 23:57:59 UTC
From:
To:
[...]

I agree. I myself use the pager frontend (with less) as well, but I
find colorization great, as it makes the changelogs more readable,
therefore I believe that it's worth having a bit of inconvenience in
favour of having this feature.

Yes. I can imagine two workarounds, but neither of these is perfect.

1) Examine if sensible-pager calls `less', and if yes, automatically
   invoke `less' as pager with the -r option, if not, then simply call
   sensible-pager with no colors.

2) Add a configuration variable to apt-listchanges which holds the
   options passed to sensible-pager. In this case, it'd be up to the
   user to tell apt-listchanges whether the pager can display colors
   and if yes, what options (if any) it needs.

I'll look into it if we can find a solution to incorporate the patch
into apt-listchanges (it's quite pointless otherwise :). You know,
this patch was a quick hack, but if you find it worth including, I'll
try to improve it (perhaps the regexps need to be fined a bit as well).

Well, this is an interesting idea, but I stick to the pager.

Ok, that's right, it just seemed first a bit odd to me.

Regards,

#111013#18
Date:
2001-11-13 03:34:27 UTC
From:
To:
I must have completely overlooked the documentation fixes in your bug
report; I thought you were just adding documentation for the option you
added in your patch.  I've applied them in CVS now, thanks.

#111013#25
Date:
2021-08-08 07:10:58 UTC
From:
To:
-- 
Best regards,

Brian T

#111013#34
Date:
2021-08-09 02:30:44 UTC
From:
To:
I am unable to reproduce the fix that was mentioned in this bug.  I
tried with less and running `export LESS="-r $LESS" and
`export LESS="-R $LESS"`.

Marking as unreproducible for now.

#111013#39
Date:
2021-08-09 07:09:03 UTC
From:
To:

#111013#44
Date:
2021-08-09 07:09:08 UTC
From:
To: