Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.66k stars 234 forks source link

Image preview is broken on macOS 12 #506

Open kvark opened 2 years ago

kvark commented 2 years ago

I'm just trying Broot for the first time (seems very nice!) and it doesn't look like the preview supports images:

broot-preview

actual image: joker-f

It may be very distantly related... but I find it hard to think that it's the best a terminal can show.

Canop commented 2 years ago

I confirm it can be better.

Here's the gnome terminal on Debian: image

Here's kitty: image

Can you tell me more about your terminal ? If it's a mac only terminal, I'll need help as I've no mac.

Canop commented 2 years ago

Can you also give me your configuration file ? do you have a special skin ?

kvark commented 2 years ago

I didn't do anything aside from brew install broot. So it's default Broot configuration in the default Terminal app on macOS.

Edit: fwiw, looks right in Alacritty on macOS, same as your image from Gnome terminal. I expected it to be on par with Kitty though.

yesenadam commented 2 years ago

Yep, same here with macOS 12. Images look a mess with Terminal, but look perfect running br in kitty.

Canop commented 2 years ago

I don't have a mac. I need someone to step in and investigate

yesenadam commented 2 years ago

Anyway, I know this thread is supposed to be a complaint, but since you're reading this Canop, the kitty+broot combination is amazing!, thank you. Soo awesome :-)

kvark commented 2 years ago

I have a mac, and I could allocate a few hours on this. Perhaps, you could provide some pointers on how to approach this?

Canop commented 2 years ago

@kvark To dive into this involve fetching the repo and diving into some Rust. The image view is built and displayed here: https://github.com/Canop/broot/blob/master/src/image/image_view.rs

The best way to try understand what happens would probably be to add some logs (see https://dystroy.org/broot/community/#log about enabling and reading them).

kvark commented 2 years ago

Hmm, on one hand this is a bit complicated. Broot -> terminad -> crossterm -> (actual terminal). On the other hand, it fails fundamentally - even the background color looks wrong (Color::AnsiValue(238) in the code). Would there be a simpler test case to play with? I.e. something that just clears an area of the screen, and preferably not going through 3-4 layers of abstraction.

Erimus-Koo commented 1 year ago

I confirm it can be better.

Here's the gnome terminal on Debian: image

Here's kitty: image

Can you tell me more about your terminal ? If it's a mac only terminal, I'll need help as I've no mac.

I'm using Kitty on a Mac, and how can I display the fine image with no mosaic like yours?

Canop commented 1 year ago

@Erimus-Koo Kitty Image protocol support is normally automatically detected. If it isn't, you may help broot recognize the terminal with this environment variable: TERM=kitty or TERMINAL=kitty (either one is OK).

If it still doesn't work, please show me your debug log.

Erimus-Koo commented 1 year ago

@Canop It's works in kitty, but I use it in tmux and not work.

I've test these situations: