Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 256 color ANSI escape sequences #1220

Open
ostrolucky opened this issue Jan 4, 2024 · 2 comments
Open

Add support for 256 color ANSI escape sequences #1220

ostrolucky opened this issue Jan 4, 2024 · 2 comments
Labels
enhancement Feature Request

Comments

@ostrolucky
Copy link

Is your feature request related to a problem? Please describe.
Following #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 ostrolucky added the enhancement Feature Request label Jan 4, 2024
@tstack
Copy link
Owner

tstack commented Jan 4, 2024

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.

@ostrolucky
Copy link
Author

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 ostrolucky changed the title Option to disable stripping of ANSI escape sequences Add support for 256 color ANSI escape sequences Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants