Diff, Less, Colour
Jonathan Ballet
jonathan.ballet at securactive.net
Thu Sep 3 02:23:35 CDT 2009
Hello,
On Thu, Sep 3, 2009 at 6:38 AM, Hatem Nassrat<hnassrat at gmail.com> wrote:
> Tue Jun 23 10:19:59 CDT 2009 Matt Mackall wrote:
>> ls -F --color=auto | less -> no color
>> ls -F --color=always | less -> mangled output
>> ls -F --color=always | less -R -> color output
>>
>> Most programs that would be on the right side of a pipe are colorblind
>> (at least by default), so most programs on the left detect that they're
>> writing somewhere other than the screen when emitting color (at least by
>> default).
>
> `git diff` seems to implement its own paging system, or somehow
> include less automatically when doing a diff and allows for a
> colourful diff while with paging. Sometimes this feature is annoying
> but most of the time it is very nice. What are the changes a switch be
> added to `hg diff` or an extension to do that?
I'm using the following configuration to do that with Mercurial:
$ cat ~/.hgrc:
...
[extensions]
color =
pager =
[pager]
pager = less
quiet = True
attend = diff,status,log,qdiff,blame,annotate,pdiff,glog
$ echo $LESS
FRSXQ
That is, I'm using the flags "FRSXQ" with less. The following
configuration allows me to have pager + color in diffs for example.
Hope it helps,
Jonathan
More information about the Mercurial
mailing list