Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@joelim-work
Copy link
Collaborator

This PR provides built-in support for sixel images, which are detected when reading the contents of a file for previewing purposes. Multiple sixel images can be displayed alongside with text if output by the previewer script.

Note

This means the sixel option is no longer required, and it is removed in this PR.


Example previewer script:

#!/bin/sh

width=$(($2 / 2))
height=$(($3 / 2))

chafa -f sixel -s "${width}x${height}" --animate off -t 1 --bg black "$1"
stat "$1" | bat --tabs 4 --terminal-width "$2" --color=always
chafa -f sixel -s "${width}x${height}" --animate off -t 1 --bg black "$1"
image

Apparently --polite on is no longer needed because this new implementation does not require the first two bytes of the previewer output to be the sixel header (ESC + P), but I think it is still better to include it in the wiki as a recommendation.

@joelim-work joelim-work added the breaking Pull requests that introduce breaking changes label Aug 25, 2025
@joelim-work joelim-work added this to the r38 milestone Aug 25, 2025
@joelim-work joelim-work merged commit 13da770 into gokcehan:master Aug 25, 2025
4 checks passed
@joelim-work joelim-work deleted the sixel-builtin branch August 25, 2025 12:19
@joelim-work joelim-work added the new Pull requests that add new behavior label Aug 25, 2025
newmanls added a commit to newmanls/dotfiles that referenced this pull request Dec 7, 2025
In lf version r38, sixel image support is now enabled by default, and the sixel option has been removed as it is no longer required ([#2109](gokcehan/lf#2109)).
theopn added a commit to theopn/dotfiles that referenced this pull request Dec 26, 2025
theopn added a commit to theopn/dotfiles that referenced this pull request Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Pull requests that introduce breaking changes new Pull requests that add new behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sixel preview writes out of bounds

1 participant