sxyazi / yazi

đź’Ą Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
14.46k stars 329 forks source link

Yazi not previewing images with --chooser-file flag #441

Closed Brixy closed 9 months ago

Brixy commented 9 months ago

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

foot version: 1.16.2 -pgo +ime +graphemes -assertions

Yazi version

yazi 0.1.5 (1d1a512 2023-12-05)

Did you try the latest main branch to see if the problem has already been fixed?

Tried, but the problem is still present

Describe the bug

Hi again!

Aerc has a file-picker-cmd, and I switched from fzf to yazi which works very well.

One thing came to my attention:

With

# aerc.conf
[compose]
file-picker-cmd = yazi --chooser-file "%f"

yazi does not preview images.

It's not crucial. Just wanted to give a hint because I don't if it is a yazi issue.

Expected Behavior

Yazi should preview images with or without the --chooser-file flag.

To Reproduce

Within aerc:

Configuration

No response

Anything else?

No response

sxyazi commented 9 months ago

When I start Yazi with yazi --chooser-file /tmp/foo, my image preview works fine.

I want to know if it works for you in Aerc without including --chooser-file?

Brixy commented 9 months ago

Thank you for getting in touch so quickly.

When I start Yazi with yazi --chooser-file /tmp/foo, my image preview works fine.

So it does with my setup.

I want to know if it works for you in Aerc without including --chooser-file?

No preview images are shown then, either (and of course it is not possible to select files as attachments).

Really just wanted to let you know in case this is important. Don’t invest too much/any work in this otherwise.

sxyazi commented 9 months ago

When I followed your steps and did the final one I got:

stat -m: no such file or directory
Brixy commented 9 months ago

When I followed your steps and did the final one I got:

stat -m: no such file or directory

Thanks! I cannot reproduce this but did some research

Not being familiar with rust the only idea I have for the original issue: Maybe some $TMP variable is overwritten by aerc?! Aerc uses /tmp/aerc-… files.

sxyazi commented 9 months ago

Thank you for the pointer. I have reproduced it after upgrading aerc.

Unfortunately, Yazi identified and used the graphics protocol correctly, but aerc's built-in terminal emulator failed to interpret them, resulting in the images not being displayed on the terminal.

And I found this, Tcell with Sixel image format. It seems that aerc doesn't support any graphic protocols currently.

Brixy commented 9 months ago

Ah interesting. Thank you so much for investigating this. I did not know that yazi kind of 'inherits' this.

So this is a pure aerc issue. If you agree I’ll close this issue and provide news here when the aerc issue is solved.

Yazi as a file picker within aerc is fantastic anyways.


By the way: As a temporary solution for previewing images in aerc I use this setting within the [filter] section—but just didn’t remember:

image/* = chafa --format symbols -
sxyazi commented 9 months ago

I will add a new config option to Yazi to allow users to manually specify the graphics mode to use, with chafa as a fallback in this scenario.

github-actions[bot] commented 8 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.