igrep icon indicating copy to clipboard operation
igrep copied to clipboard

Preserve ANSI escape sequences

Open ncfavier opened this issue 2 years ago • 2 comments

It would be nice to have an option to preserve ANSI escape sequences in the main view, similar to less's -r or -R flags. Currently it seems like the ESC characters are stripped, leaving only things like [94m[33m.

ncfavier avatar Oct 22 '23 10:10 ncfavier

Is it similar request to this one: https://github.com/BurntSushi/ripgrep/issues/519? If so, BurntSushi's response applies here as well.

konradsz avatar May 16 '24 18:05 konradsz

No, ripgrep has the correct behaviour:

$ printf '\e[0;34mfoo\n' > foo
$ rg . foo # shows "foo" in blue
$ ig . foo # shows "[0;34mfoo"

That issue is about ignoring escape codes in search, i.e. interpreting those sequences and excluding them from the text. I am asking to leave the sequences alone so that they can be interpreted by my terminal.

ncfavier avatar May 16 '24 18:05 ncfavier