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

[QUESTION] Is it possible to preview images in WezTerm on MacOS? #678

Closed
is0n opened this issue Aug 9, 2021 · 4 comments
Closed

[QUESTION] Is it possible to preview images in WezTerm on MacOS? #678

is0n opened this issue Aug 9, 2021 · 4 comments
Labels

Comments

@is0n
Copy link

is0n commented Aug 9, 2021

I imagine this is possible as WezTerm supports image previews, however, I haven't seen any mention of this in the wiki.

@idr4n
Copy link

idr4n commented Aug 16, 2022

I'm wondering this as well. I tried wezterm imgcat $1 which is the command to preview images in WezTerm but it didn't work. I wonder if there is a way as WezTerm seems to do a good job in displaying images.

@latipun7
Copy link

latipun7 commented Nov 7, 2022

As mentioned by @gokcehan in #675 (comment)

Long answer, we interpret escape codes ourselves for the previews instead of pushing them directly to the terminal. Currently we only have standard color escape codes and other things are ignored.

As I understand, WezTerm imgcat is converting image to iTerm2 Graphics Protocol which WezTerm could interpret that and display as image. While displayed in lf, unknown escape codes are ignored so the image is not displayed inside lf.

At some point, I thought about pushing unknown escape codes directly to the terminal so things like sixels might work.

I really want this to be implemented so maybe lf can display images based on terminal capabilities. That would make user easier to add image previewer inside lf based on terminal they use without adding more dependencies i.e. ueberzug (which only works on X11).

@NickHackford
Copy link

NickHackford commented Jul 6, 2023

You can do this. You need to have kitty installed and copy the kitty preview scripts from the wiki.

@joelim-work
Copy link
Collaborator

Sixel support was officially added in dd82949, so this should be possible so long as you install a tool like chafa to convert the images to Sixel format. This is now documented in the wiki.

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

No branches or pull requests

6 participants