lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Add support for 256 color ANSI escape sequences

Open ostrolucky opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Following https://github.com/tstack/lnav/issues/1219, I'm trying to use GNU Source-highlight. But I have discovered that lnav seems to be stripping out all the ANSI color codes. Can this be disabled?

Reproducer: :sh echo -e "\e[38;2;255;0;0mHello world\e[0m"

ostrolucky avatar Jan 04 '24 11:01 ostrolucky

lnav converts many escape sequences, but doesn't handle this one at the moment. For example, this will work:

:sh echo -e "\e[32mHello world\e[0m"

Internally, lnav uses ncurses to handle the display and ncurses doesn't not directly accept ANSI escape sequences. So, the conversion needs to be done manually. I'll look into adding support for this sequence.

tstack avatar Jan 04 '24 16:01 tstack

Oh indeed. Looks like escape sequence I posted and the one that software uses are 256 colors, which is something lnav doesn't support. But it does support traditional 16 colors!

ostrolucky avatar Jan 04 '24 16:01 ostrolucky