kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.45k stars 153 forks source link

ANSI escape codes not working in preview #310

Closed rijkvp closed 1 year ago

rijkvp commented 1 year ago

I am using the preview_file.sh from this repository to display previews. However, the ANSI escape codes does not seem to work:

image

I'm running the latest 0.9.4 release.

DLFW commented 1 year ago

Hi! You're sure that you have a recent Joshuto version and not disabled the “syntax_highlight” feature? Which bat version do you have installed?

literaryno4 commented 1 year ago

I have the same problem with the same 0.9.4version when I use the example config. I think this is a bug of joshuto not bat because the bat and other preview tools like jq work well with syntax highlight in my terminal.

I am using macOS Monterey(version 12.5, intel chip)

DLFW commented 1 year ago

So you use the exact version 0.9.4? That is from mid of last year (quite old) and it seems that the "syntax_highlight" feature was not enabled by default at the time.

Not a bug, just the default build-config a year back. I think that changed Jan 2023 after fixing some issues with the lib that's used for interpreting the escape sequences. There were a couple of problems with it....

Try to build the latest Joshuto from the repo.

rijkvp commented 1 year ago

Building the latest Joshuto from the repo fixed it!

I also looked at the Cargo.toml on the main branch, which had the syntax_highlight feature but didn't realise that it was from a newer version.

Are there any plans to release a new version?

kamiyaa commented 1 year ago

New version released 👍 d921fc1f793467c3fe2c8f31285f3e1c51c1a328