thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

Image preview not working in ranger and w3m can't show them #501

Closed alkeryn closed 3 years ago

alkeryn commented 7 years ago

That's about it here is an expample screenshot image I don't have this issue on urxvt but i prefer termite please fix this :/ also the termite-ranger-fix from AUR didn't solved the issue

jelly commented 7 years ago

Well your bugreport isn't really informative. Disregard that, I can't get the image preview working in rxvt and xterm with the suggestions in https://github.com/ranger/ranger/wiki/Image-Previews

To be honest the feature is really a hack in w3m.

alkeryn commented 7 years ago

Well i switched to urxvt in the end, sad since i love some of termite features but meh that's like it ^^

MarcelRobitaille commented 7 years ago

Would it be possible to implement something like urxvt pixbuf?

mrneilypops commented 7 years ago

It would be great to get ranger image preview working in termite. I am loving termite but still have to use urxvt for ranger...

jelly commented 7 years ago

@mrneilypops sure, I have no idea what the limitation is however and it does not work for me in urxvt.

teto commented 7 years ago

I use termite and ranger preview works just fine (even got video preview working)

oblitum commented 6 years ago

I'm getting just "list index out of range" while browsing and with w3m installed/image previews enabled. w3m works fine when executed for image preview.

oblitum commented 6 years ago

Hmm, nevermind, w3m is just opening an external imagemagick X gui no matter what I do, and if I open a web page it doesn't preview images in the terminal at all. Not sure how people get this working.

oblitum commented 6 years ago

@teto can you please tell what you do to make it work? I'm on ArchLinux, and as I said above, it simply doesn't.

asoltysik commented 6 years ago

Bumping the question to @teto

teto commented 6 years ago

I don't remember doing anything extraordinary, my ranger config is https://github.com/teto/home/blob/master/config/ranger/rc.conf, just set imagepreview. w3m needs to be in path with some access to fbcon. Maybe you need to check w3m version ? maybe there is some compilation time flag. You should try to see images with w3m first before trying with ranger. Note that the preview is not always perfect, sometimes some colors are off etc.

wulvyrn commented 6 years ago

The default ranger file has this line which isn't in your rc.conf file:

set preview_image_method w3m.

I'm also using termite with ranger on sway with this issue.

1094 commented 6 years ago

I am using i3 4.15.0.1 with termite v13, ranger 1.9.1, and w3m 0.5.3, with the following in my rc.conf:

set preview_script ~/.config/ranger/scope.sh  
set use_preview_script true  
set preview_images_method w3m 

The previews do not show on default, I have to use zi.

thu-00 thu-15

The only problem I'm having is that some of the previews break my termite background color which I am assuming is related to the ranger/w3m transparency issue).

oblitum commented 6 years ago

Hey! Exactly like @1094, it's working now for me too. It doesn't work inside TMUX. Also, I'm getting the same transparency issues.

alkeryn commented 6 years ago

Oh sorry didn't saw it followed well i use urxvt for ranger here is my rc.conf and my .Xressource rc.conf : https://pastebin.com/FZFXf6ge .Xressoource : https://pastebin.com/D21MxqhX And it look like it : image Though being able to use termite only would be much appreciated

mainrs commented 6 years ago

I am using termite and just set the image preview flag to true. The image is showing up when I select the image in the list.

mhham commented 6 years ago

For me the image preview is working, but when I move to another item (say a text file), the whole background becomes transparent, except the area with text (cf. screenshot below)

screenshot_ranger

FYI, I am using a compositor (compton) and rgba background for termite

alkeryn commented 6 years ago

@mhham What are your termite and ranger config ? because it don't work like that for me

mhham commented 6 years ago

@Alkeryn

Here are my configs :

alkeryn commented 6 years ago

Welp i found out what was the issue it turns out it is due to bspwm because it does work in termite + i3 but not on termite + bspwm though it work on urxvt + bspwm so that's weird

mhham commented 6 years ago

I am using termite + i3, so I guess this is not really the issue.

alkeryn commented 6 years ago

@mhham Did you read my comment ?, i explicitly said the issue was bspwm ^^

Xarchuser commented 6 years ago

@Alkeryn did u find any solution? that issue happens when i use termite + bspwm however urxvt it works well on bspwm, termite on another window manager works well too, it's odd...

Xarchuser commented 6 years ago

look at that , urxvt vs termite on bspwm

21-06-18_11 23 07

derrickcope commented 6 years ago

is there any update on this? I am using termite + bspwm + vifm. The image preview works in urxvt but not termite. Has anyone gotten the preview to work with termite + bspwm?

alkeryn commented 6 years ago

@derrickcope I think the issue is with bspwm anyway i switched to st works well there

Moelf commented 6 years ago

I'm using sway (wayland i3), urxvt works but termite doesn't with ranger image preview.

andreabolandrina commented 6 years ago

I use i3+termite and I got it to work by updating the original scope.sh file.

In general, I think the procedure should be: 1) make sure your w3m image preview work (eg with w3m xkcd.com) 2) make sure you have w3mimgdisplay enabled (https://github.com/ranger/ranger/wiki/Image-Previews#with-w3mimgdisplay) 3) if it still does not work, you might need to update scope.sh like me (~/.config/ranger/scope.sh), by manually deleting it first, and then run "ranger --copy-config=scope"

Hope it helps! Andrea

alkeryn commented 6 years ago

@andrea-82 ofc you won't have the issue you are running i3 the issue only apear when you use termite + bspwm or termite + sway idk the reason but that's a bug that apear only when both are combined

alkeryn commented 6 years ago

@patrick-motard No this dosen't fix anything, because the issue isn't with ranger, but with termite + bspwm combo you just didn't understood the issue please read before saying that you 'fixed' an issue

patrick-motard commented 6 years ago

@Alkeryn I said explicitly in that commit that I now have previews working using w3m and other users configs found in this issue. At NO POINT did I say that I either understood this issue or had "fixed it" in any way. It's not even a fork. It's a completely different project that is tangentially related. The reference to this issue in MY commit in MY project was to provide breadcrumbs for myself and my projects users as to how I came to the change in that commit.

cpadilla commented 6 years ago

I'm experiencing this issue as well, only I'm using dwm as my window manager. Image previews work in urxvt but not when I use termite (or st).

I've tried using compton and xcompmgr and even tried it without a composite manager but I can't get it to work in termite. Has there been any update on this issue?

oblitum commented 5 years ago

This issue may change behavior depending on compositor it seems, I changed from xcompmgr to compton and the behavior changed, now when changing between images, the background of the previous one isn't cleared, so a smaller image appears on top of the last, and this keeps stacking.

Pablo1107 commented 5 years ago

I enable the image preview using w3m but when I preview on an image which is larger than other, the section of the large image stay in the frame bugged until other photo gets on top of it resulting in this look.

https://imgur.com/4JPWHIG

Anyone having this issue?

ShayBox commented 5 years ago

I don't know where to go with this, is it considered a termite, bspwm, or w3m problem... I guess i would say termite, the program is named after a bug after all :joy: I guess i'll just switch to urxvt in the mean time.

alkeryn commented 5 years ago

@ShayBox Both It only happen when using termite + bspwm termite + i3 works urxvt + bspwm works termite + bspwm don't work

ShayBox commented 5 years ago

There must be a technical reason though, like bspwm doesn't do something that termite needs to do something that w3m needs, idk, not really my league here, still very strange that this requires 3 separate things to happen.

alkeryn commented 5 years ago

@ShayBox Yeah what i'd think but the weird thing is that w3m does work on urxvt on bspwm

alkeryn commented 5 years ago

Hi guys, i think you might be interested about a fix i found i just stoped using w3mimage and i now use ueberzug and it works even better than w3m here is an example image And it can even do full preview and supports resizing : image

lvictorino commented 5 years ago

Hey @Alkeryn could you please share your rc.conf please? I can't manager to use ueberzug with ranger. Thanks.

alkeryn commented 5 years ago

@lvictorino It isn't in the stable / release ranger version yet, you need to use ranger-git but here are my dotfiles : https://github.com/Alkeryn/dotfiles/tree/master/.config/ranger

ifohancroft commented 5 years ago

Don't use w3m's image view, use ueberzug instead. It works flawlessly with ranger and Termite. All you have to do is install a recent version of ranger (so it supports ueberzug - You can check the rc.conf of ranger - if it supports ueberzug - it will be listed in there as one of the supported image preview methods) and ueberzug. Then in rc.conf enable image previews and change the image preview method from w3m to ueberzug. w3mimgdisplay has issues of its own so it may not even be Termite's fault.

P.S. I suggest we close this issue and add an entry in the wiki on here for image previews in Termite with ranger and ueberzug?

alkeryn commented 5 years ago

@ifohancroft I already mentioned ueberzug like 3 comments over ^

ifohancroft commented 5 years ago

@Alkeryn Sorry. I must have missed it.

boreq commented 5 years ago

I was using the newest ranger ranger-1.9.2-1 and ueberzug wasn't listed as supported. Neither did it work if set in the config.

To fix that on Arch Linux: In order to use ueberzug you need to install the unreleased ranger version from the master branch. Switch to the package ranger-git to use it. You should then be able to change your config to include set preview_images_method ueberzug and install python-ueberzug to make it work.

oblitum commented 5 years ago

@boreq many thanks!!! this finally fixes the long standing issue I had with w3m when browsing images and the previously larger browsed image never properly cleared up for displaying the next that simply looked like put on top of the previous.

Mishio595 commented 5 years ago

Even after switching to ueberzug, I'm experiencing this issue. I'm using Sway. urxvt + w3m -> works urxvt + ueberzug -> works termite + w3m -> no preview termite + ueberzug -> no preview

Versions ranger - master (pulled from git today) python - 3.7.3 ueberzug - 18.1.3 termite - v15

alkeryn commented 5 years ago

@Mishio595 ueberzug can't work in wayland w3m can't work in termite most of the time At that point you should open an issue for wayland support on ueberzug

Mishio595 commented 5 years ago

Well, I figured I would try it seeing as termite is the emulator sway recommends and this thread relates to my issue. Disappointing that the only thing close to a solution or workaround anyone has suggested only works under X11.

Edit: The ueberzug creator already turned down Wayland support https://github.com/seebye/ueberzug/issues/30

benesposito commented 5 years ago

@Mishio595 Did you every find a solution? I am also on Sway and urxvt+w3m works but I use Termite which doesn't work with w3m or ueberzug.