On 2024-03-25 15:49:52 +0100, Vincent Lefevre wrote:
> A solution for "grep" would be to add a space+backspace before the
> escape sequence.

An additional note: One of the following is needed:

* Detect the end of line (this may be tricky) and split the coloring
  into 2 parts (each one with space + backspace + escape sequence)
  at this point. If this detection is incorrect, then the background
  problem would still be visible, but with no major drawbacks.

* Split the coloring so that each matching character gets a space +
  backspace + escape sequence. I think that this is acceptable since
  this trick should be used only when the output is a tty (i.e. it
  is not redirected to a file / not piped to a pager or something
  else).

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Reply via email to