I have less
already displaying colored output (e.g. from Vagrant or Packer) by having the LESS
environment variable set to -R
.
What I'd like to be able to do now is to search for specific colors, e.g. ESC[1;31m
for red.
I tried various combinations (e.g. \[1;31m
) but it seems that less
ignores them in its search when in -R
mode. When I toggle -R
off it finds them, though. This could make sense when you think of it because the entire sequence is considered as having "zero width" so there is nothing for less
to show when it finds it.
Is there another trick I can use?
To recap - the aim is to keep viewing colored output but also be able to search the color escape sequence at the same time.
0 Answers