Skip to content

Images stack on each other #271

@ABlueDruid

Description

@ABlueDruid

I'm basically using chafa as fzf preview for some script of mine. But there is the issue of image staking on one another.

Here is the code snippet

selected_files="$(fzf --multi --height=50% --layout=reverse --preview-window=right:60%:wrap \
    --preview='
        mimetype=$(file --mime-type -b {})
        case "$mimetype" in
            image/*)
                chafa --clear --view-size 22x40 {}
                ;;
            text/*)
                batcat --style=numbers --color=always --line-range :500 {}
                ;;
            *)
                echo "No preview available"
                ;;
        esac
    '
)"

here the output looks like this in my suckless st

untitled.mp4

In st there is no over staking of pictures (picture previews are rather cancerous here though LOL. (Just kidding, Great Project)) & the hello text is also visible. Also when closed the preview also vanishes as expected.

But with kitty its a different story

untitled-kitty.mp4

Here the pictures stack even after --clear flag is added. And the hello text in the end also gets covered up by the stacked previews. And the pictures stay in that same place even after script is finished or overruled.

Same story with Konsole.

Is there any solution to this?
I can use it with st (it does not have any graphics patch applied) but if you give me a snippet to make it look a little better it'll be damn helpful.

Thank You in advance for this great project. (Love it and Use it a lot)

CHAFA VERSION:
Chafa version 1.14.0

Loaders: AVIF GIF JPEG PNG QOI SVG TIFF WebP XWD
Features: mmx sse4.1 popcnt avx2
Applying: mmx sse4.1 popcnt avx2

OS INFO:
Linux Mint 22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityCompatibility (e.g. terminal quirks)featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions