-
Notifications
You must be signed in to change notification settings - Fork 343
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
MacOS imag-preview #44
Comments
can you post the output of mine is |
Same... Does it work for you ? @westofer |
yes it works, are you using fish by any chance? becuase it doesn't work in fish for me |
sure @Jac-Zac |
https://discord.gg/FNym2zpK This is the discord server if we find helpful we might also expand it in the future and add it to README.md |
Ueberzug relied on X11 so it wouldn't work in system that doesn't use X11 I know it's late but this might be helpful to some people who have this issue |
Yes people on wayland are also having this issue. If anybody knows a terminal viewer that work on wayland + mac do let us know. |
Would w3m work? |
@pystardust Ranger file manager has iTerm2 support for image previews, so maybe look at what it's doing. I don't have a Mac but it worked for me with Alacritty when pulling in the graphics PR that adds iTerm2 protocol & libsixel (though it looks like it won't be merged as it is). |
I also like the way |
My I am not very keen on using a non-upstream version of Alacritty for now but might be willing to try pulling the above-mentioned graphics PR. Is there anything us the macOS users can do to have the images previewed in our terminals? |
Try to change the code in ytfzf a bit to use iTerm2's own image renderer. Tbh even I'd like if there were options like neofetch - I'd use my kitty terminal's internal renderer. |
I think we should do it like you said using iTerm's own image viewer like they have done here. This is the iTerm page. But you can't just use the imgcat script because fzf will just output the long string. If anybody has some ideas on what we can do I would be wiling to work together to try to solve it maybe on discord |
I will try to implement different image viewers similar to |
Yes I have tried w3mimg, it works well only with some terminals(urxvt) #!/bin/sh
path_to_w3mimg=~/.bin/w3mimgdisplay
showimage () {
printf '%b\n3;\n4\n' "0;1;20;20;$((FZF_PREVIEW_COLUMNS *55/10));$((FZF_PREVIEW_COLUMNS *55/10));;;;;$1" | "$path_to_w3mimg" &>/dev/null
}
if [ "$#" -eq 1 ]; then
showimage "$1"
else
fzf --preview "sh $0 {}" --preview-window "left"
fi
|
If this seems fine, then we could add this feature in ytfzf |
Can someone with macOS test this script? |
@Z5483 Which script exactly? The one that uses |
yes, the #!/bin/sh
path_to_w3mimg=~/.bin/w3mimgdisplay
showimage () {
printf '%b\n3;\n4\n' "0;1;20;20;$((FZF_PREVIEW_COLUMNS *55/10));$((FZF_PREVIEW_COLUMNS *55/10));;;;;$1" | "$path_to_w3mimg" &>/dev/null
}
if [ "$#" -eq 1 ]; then
showimage "$1"
else
fzf --preview "sh $0 {}" --preview-window "left"
fi copy fhe above into a file and make the file executable using |
I can't run that script because I have no |
install w3m |
@westofer Installed it via |
mine was in |
Already did that. It's nowhere to be found. I don't think the |
it might be related to this issue tats/w3m#95 |
OK, cloned, compiled with the right options, changed the path in the above script, ran it in both iTerm2 and Alacritty (in a directory that has images in it), moved with the keyboard arrows until I got to an image in the file list -- nothing appears on the left. Also waited for I am seeing a blank black pane on the left. It has borders but no content. Also pressed ENTER when selecting an image -- I only get the image file name as an output of the script. I am new to w3m. Is there a way to test image showing in the terminal in isolation like with |
Another thing. Somewhere along the whole stuff an XQuartz installer popped up in the background which I didn't notice. I went through its installation and logged out and back in as the installer requested. Results are the same. Maybe |
This is outside of my knowledge since I'm not familiar with macOS. I think unlikely that you will have to recompile
I will take at a look at the |
I can confirm that the w3mdisplay script results in the image flickers then disappears |
Could someone with a mac try using iTerms image viewer and make a script that would display an image given as input, with the give height and width at a given coordinate |
Instead of specifically relying on iTerm's imgcat (you can't even reposition the image, and there might be users of other terminals too such as Kitty or Wez's), perhaps you could take a look at timg? It plays nicely with |
it is hard to implement image viewers that don't use ascii characters because of the way fzf's preview works, it basically only accepts ascii, the reason ueberzug works is because it's it's own window, w3m could possibly work, but whenever you try to use it the image is only on the screen for about .2 seconds. viewers i tried that didn't work (all of which are proper image viewers)
until something gets implemented for all OS/display servers, i'd recommend chafa as it seems to be the best, but it's your choice |
I have implemented w3m, see my latest comments on #64. |
With kitty support broken/removed and sixel not supported by fzf is there any option left for Mac users to preview images in the terminal? |
Hey everyone, I have been developing this project, https://github.com/jstkdng/ueberzugpp, it is a drop in replacement for ueberzug but with aditional features such as sixel, kitty and iterm2 support. @Euro20179 has kindly added support for my project in ytfzf development branch and so far under linux all 4 outputs work (x11, kitty, sixel, iterm2). |
Trying to run the development branch to test it on mac gives me this error: ./ytfzf
./ytfzf: line 3109: syntax error near unexpected token `;;'
./ytfzf: line 3109: ` youtube-dl) ${ytdl_path} -F "$1" ;;'``` |
What is the output of |
I get this:
echo $SHELL Indeed by running: |
I'll look into that later, for now run |
Mmmm maybe it is just my problem and for some reason my sh is still liking to zsh and it should link to something like dash or bash. If I run it as you said it runs but the previewer doesn't work since it still try to run with zsh. If I change the shabang from sh to dash I get it to work though |
Nah, ls said that /usr/bin/sh doesn't exist in the first place, it's not linking to anything. ytfzf uses And just to confirm, thumbnails do work with iterm2? |
Oky but: |
I have also tried with: |
Oh, nvm then.
Ueberzug wont work, linux only, apparently iterm2 is not in the newest version of ueberzugpp, so it needs to be compiled manually if your up for that, if you're not up for it, it's all good. |
What exactly should I do ? btw I meant that I have tried with ueberzugcpp not ueberzug since I have that in my path with the name ueberzug |
ytfzf checks specifically if you have Then run If that doesn't work you could try the following: ueberzugpp needs to be compiled manually (until iterm2 gets put into a release), as instructed on the ueberzugpp readme, make sure to disable x11 support. Put the binary, and a copy named run |
X11 support should work in theory since MacOS has xquartz, the terminal also has to run through xquartz though. The same reason x11 works in wayland, only if the terminal is also running through xwayland. |
Nice! As for the error, it might've just failed to download the image. |
Ohhh sorry, It also works for me, but yesterday was very late and I made a symlink to |
Lol, glad it works though! |
nice, I also fixed the proc issue. Now I think some more testing could be done by other users? I'll try to create a homebrew package. |
I have created a release with iterm2 and macos support. I've also created a homebrew script but it will take some time before it is included in homebrew-core. |
Once I release 2.6.0 I will close this (assuming there are no other issues). |
Just to make you aware of this, preview of thumbnails doesn't work on macOS. The script download the images were it should, but it doesn't show them. It looks like the problem has to do with Überzug. I also tried to run fontpreview-ueberzug which won't work either. But I might also be wrong so if other people have mac they might be helpful. I also tried to used Überzug to preview images in ranger and It doesn't work. In ranger they use a preview for that works with iTerm terminal emulator. An example is imgcat
The text was updated successfully, but these errors were encountered: