miette icon indicating copy to clipboard operation
miette copied to clipboard

Can't get `syntect-highlighter` to work

Open froth opened this issue 1 year ago • 3 comments

I tried to get syntax highlighting to work according to the new Readme section, but could not succeed. I think the problem is somewhere on my side but I can't figure it out.

I created this minimal project https://github.com/froth/miette-highlighting/blob/main/src/main.rs and it does not highlight on my machine. Screenshot from 2024-02-06 09-41-05

The same code is highlighted correctly using cargo run --example syncat test.rs in https://github.com/trishume/syntect/.

froth avatar Feb 06 '24 08:02 froth

cc @kallisti-dev

zkat avatar Feb 06 '24 20:02 zkat

@froth I was able to reproduce this issue with the provided example crate just a month ago, but now it's working... exact same miette version.

So I am wondering if this is somehow related to terminal color detection. Maybe either a bugfix in the supports-color crate resolved the issue or maybe my local terminal emulator patched something (I'm running Wezterm with tmux on Mac OS). Just throwing some ideas out there but nothing is confirmed at this point.

Which terminal emulators/multiplexers are you using when running this? Can you do a clean build (rm -rf target) on the example crate and verify that you are still having this issue?

erratic-pattern avatar Mar 24 '24 17:03 erratic-pattern

Thanks for having a look @erratic-pattern!

rm -rf target did not change anything for me.

I also tried cargo upgrade and removing Cargo.lock. Both not successful for me.

I am using zsh in tmux in gnome-terminal. Additionally I tried xterm with bash without tmux.

Very weird that it somehow fixed itself for you.

froth avatar Mar 24 '24 18:03 froth