Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chafa version 1.14 breaks image preview on lf #185

Open
Steven79203 opened this issue Jan 20, 2024 · 4 comments
Open

Chafa version 1.14 breaks image preview on lf #185

Steven79203 opened this issue Jan 20, 2024 · 4 comments
Labels
compatibility Compatibility (e.g. terminal quirks)

Comments

@Steven79203
Copy link

After an Arch system update I noticed that chafa stopped working properly on lf. Instead of showing the image it only shows random characters on the preview space. Tested on both foot and alacritty-sixel terminals. After downgrading to 1.12 it started working normally again. Curious though is that if I open an image with chafa on the command line out of the file manager it works normally even on version 1.14. That seems to be a conflict between this new version of chafa and lf.

@hpjansson
Copy link
Owner

Hi, thanks for reporting this. How is the preview function configured on your lf (i.e. ~/.config/lf/lfrc and any helper scripts)?

Does it help if you add --polite on to the chafa command line?

Failing that, could you attach a screenshot of the broken output?

@Steven79203
Copy link
Author

This is a excerpt from my lfrc:

set autoquit true
set shellopts '-eu'
set ifs "\n"
set scrolloff 10
set icons
set info size
set period 1
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
set ratios 1:1:2:3
set shell "bash"
set sixel true
set previewer ~/.config/lf/preview

This is the image previewer function in the previewer script

image() {
	geometry="$(($2-2))x$3"
    chafa "$1" -f sixels -s "$geometry" --animate false | fold -w 65535
}

But by adding the '--polite on' option it worked again on version 1.14.

@hpjansson
Copy link
Owner

Great. Looks like I can detect lf by looking at LF_LEVEL in the env. Polite will be the default under lf in the next release.

@veltza
Copy link

veltza commented Jan 20, 2024

Here's why lf doesn't work with --polite off:
gokcehan/lf#1509 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility (e.g. terminal quirks)
Projects
None yet
Development

No branches or pull requests

3 participants