grc icon indicating copy to clipboard operation
grc copied to clipboard

Line disappear when use search in less

Open crile opened this issue 7 years ago • 1 comments

Hi,

I use "less" command with grcat but when I make a search on pattern that are in grcat configuration the line that contain a match disappears.

To reproduce:

  • conf.my_log
regexp=Critical
colours=red
======
regexp=Warning
colours=yellow
  • log/1.log contain lot of Warning string
  • cat log/1.log |./grcat conf.my_log |less -r
  • Then search in less /Warning
  • The first line that contain Warning disappear

Am I the only one to encounter this issue ?

crile avatar May 04 '18 13:05 crile

Though I cannot reproduce it exactly (I guess it depends on the terminal), I have seen similar behaviours - less manpage says:

 Warning: when the -r  option  is  used, less  cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each  type  of  control  character). Thus,  various display problems may result

You can try less -R, this outputs only ANSI colour codes in raw mode, and, I usually use lv -c instead of less, it works almost perfectly in all the cases.

garabik avatar Dec 25 '18 19:12 garabik