beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

use of parentheses generates colorized output even when --nocolor is given #475

Closed dupuy closed 10 years ago

dupuy commented 10 years ago

This is related to #302 and #364; if the ack matching pattern contains capturing parentheses, colorized output is generated even if --nocolor is specified:

$ echo foo | ack --nocolor '(foo)' - | cat -t
^[[30;43mfoo^[[0m

As with the other bugs, you can work around this by using (?:):

$ echo foo | ack --nocolor '(?:foo)' - | cat -t
foo
hoelzro commented 10 years ago

@dupuy What version of ack is this on? I just tried with ack built from 963d82a and I didn't see this.

dupuy commented 10 years ago

I was using ack version 2.02; when I saw the related ticket #364 was still open, it didn't occur to me to check my particular corner case against a newer version.

A brew install of 2.12 eliminates the problem, so closing.