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

Sixel support in foot does not get recongnized correctly #130

Closed
Sivecano opened this issue Jan 15, 2024 · 8 comments
Closed

Sixel support in foot does not get recongnized correctly #130

Sivecano opened this issue Jan 15, 2024 · 8 comments

Comments

@Sivecano
Copy link

the foot terminal supports sixel, timg does not correctly recognize this. timg does render correctly if sixel is forced by the -ps option.

@hzeller
Copy link
Owner

hzeller commented Jan 26, 2024

I am currently not running Wayland, so can't test. When you run the following, does the terminal print out something ?

echo -e "\033[>q"

(typically some version number and terminal name surrounded by some escape codes).

For now, you can set the TIMG_PIXELATION environment variable (see timg --help), so that you don't have to provide -ps all the time.

@Sivecano
Copy link
Author

on zsh I get this
image
(so ^[P>|foot(1.16.2-14-g14472cdb)^[\% )

@Sivecano
Copy link
Author

thanks so much :)

@hzeller
Copy link
Owner

hzeller commented Jan 26, 2024

Alright, added detection.

Do Videos and --grid mode look alright ? (e.g. no vertical wnadering of videos and proper vertical alignment of items in a grid). There are two slightly different flavors of what terminals implement that affect that. If things look good, nothing else needs to be done, if not (unlikely), I've to change one more thing.

@Sivecano
Copy link
Author

Sivecano commented Jan 26, 2024

Video will fill the terminal with the bottom most row (of 1 character height) until the video arrives at the top of the terminal.
in grid mode pictures wander upwards and sometimes don't seem to reserve the correct amount of vertical space.
image

@hzeller
Copy link
Owner

hzeller commented Jan 26, 2024

Alright, can you git pull and try again ? Hopefully that fixes the video and grid issues.

@Sivecano
Copy link
Author

Sivecano commented Jan 26, 2024

so... grid works but only with some numbers of columns. like 1 to 4 work, 5 exhibits the previous issues, and then 9 again.
I can't even imagine why this is happening.
for videos it sometimes still duplicates the bottom most line but for the most part it works as intended.
it seems to depend on the specific file....

out.mp4

@hzeller
Copy link
Owner

hzeller commented Jan 26, 2024

I suspect the pixels where character cells are shown are not placed on integer pixel positions. Timg needs to know the characcter cell height, so that it knows how many of them to 'jump up' to show the next picture. If it reports say 10 pixels height of a character cell and the picture is 120 pixels high, then timg uses 120 / 10 = 12 characters to place the cursor to the place where the next image is to be shown. If whatever the terminal reports is different from what it internally uses to place cursors.

The terminal reports the size of the canvas and each character cell (which you see if you show a picture and add the --verbose function). Since I don't have insights with the foot terminal, maybe file a request with them to figure out ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants