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

Support text with embedded ANSI codes for the higlight line #2621

Closed
nkh opened this issue Jul 14, 2023 · 5 comments
Closed

Support text with embedded ANSI codes for the higlight line #2621

nkh opened this issue Jul 14, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@nkh
Copy link

nkh commented Jul 14, 2023

screenshot_2023-07-14_11-27-32

@nkh nkh added the feature-request New feature or request label Jul 14, 2023
@eth-p
Copy link
Collaborator

eth-p commented Jul 18, 2023

Good catch!

I suspect what's happening here is that the "tmux" there is actually:

  ^[[33m tmux ^[[0m
  ~~~~~~      ~~~~~
  yellow      reset

The reset (SGR RESET) clears all the style information, which happens to include the background set by the line highlight. It shouldn't be too hard to put the line highlighting styles back after we encounter a reset.

#2544 has some changes that would greatly assist in fixing this, so I'll address this after that gets merged.

@eth-p eth-p added bug Something isn't working and removed feature-request New feature or request labels Jul 18, 2023
@nkh
Copy link
Author

nkh commented Jul 18, 2023

I'm adding the colors, and there can be many added on a single line. Here's how it looks like

screenshot_2023-07-19_00-10-08

screenshot_2023-07-19_00-10-38

@eth-p
Copy link
Collaborator

eth-p commented Feb 10, 2024

Hey @nkh, if it's not too much trouble, would you be able to provide me with a text file and theme to reproduce this issue?

I'm using your example above, and I can't seem to get it to break on the latest version of bat :

image

image

@nkh
Copy link
Author

nkh commented Feb 10, 2024

@eth-p I'll check with the latest version and get back to you.

@nkh
Copy link
Author

nkh commented Apr 6, 2024

Seems to work in 0.24, thanks.

@nkh nkh closed this as completed Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants