broot icon indicating copy to clipboard operation
broot copied to clipboard

Image preview is broken on macOS 12

Open kvark opened this issue 3 years ago • 22 comments

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.

kvark avatar Feb 18 '22 19:02 kvark

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 avatar Feb 18 '22 20:02 Canop

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

Canop avatar Feb 18 '22 20:02 Canop

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.

kvark avatar Feb 18 '22 20:02 kvark

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

yesenadam avatar Apr 16 '22 04:04 yesenadam

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

Canop avatar Apr 16 '22 04:04 Canop

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 :-)

yesenadam avatar Apr 16 '22 04:04 yesenadam

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

kvark avatar Apr 16 '22 04:04 kvark

@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).

Canop avatar Apr 16 '22 04:04 Canop

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.

kvark avatar Apr 16 '22 05:04 kvark

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?

Erimus-Koo avatar Jun 11 '23 08:06 Erimus-Koo

@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.

Canop avatar Jun 11 '23 09:06 Canop

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

I've test these situations:

  • In kitty / br / preview panel, works.
  • In kitty / tmux pane / br / preview panel, not works.
  • In kitty / tmux pane / kitty +kitten icat 'abc.png', works.

Erimus-Koo avatar Jun 11 '23 13:06 Erimus-Koo