You are not logged in.

#1 2014-07-19 10:58:32

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

w3m/ranger images don't work on urxvt

I'm trying to get ranger (which actually uses w3m, afaik) to render images inside my terminal.
From what I've read, this should work on both xterm and urxvt. I'm configured everything properly, and it works fine on xterm, but not on urxvt (which is actually my everyday terminal).

I've really no idea where to start looking, since it's "meant to work" without any special settings. Any suggestions?

Offline

#2 2014-07-20 23:37:32

monodromy
Member
Registered: 2014-02-08
Posts: 62

Re: w3m/ranger images don't work on urxvt

Not sure if this is helpful, but I couldn't get w3m-img + ranger to work with tmux. When I switched to urxvt-tabbed, everything worked fine.

Offline

#3 2014-07-21 02:46:09

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: w3m/ranger images don't work on urxvt

The last time I checked, it wasn't rxvt-unicode that supported it, but rather just plain 'ol rxvt.  But you should probably try using tmux since a) it is kick ass, and b) monodromy says it works.

Offline

#4 2014-07-21 05:38:06

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: w3m/ranger images don't work on urxvt

hobarrera wrote:

I'm trying to get ranger (which actually uses w3m, afaik) to render images inside my terminal.
From what I've read, this should work on both xterm and urxvt. I'm configured everything properly, and it works fine on xterm, but not on urxvt (which is actually my everyday terminal).

I've really no idea where to start looking, since it's "meant to work" without any special settings. Any suggestions?

Do you mean this (in ~/.config/ranger/rc.conf)?

# Preview images in full color with the external command "w3mimgpreview"?
# This requires the console web browser "w3m" and a supported terminal.
# It has been successfully tested with "xterm" and "urxvt" without tmux.
set preview_images true

I did that and it works as advertised. With up-to-date xterm and rxvt-unicode.
Indeed it doesn't work in tmux but does in screen.

To take ranger out of the picture for debugging you might call w3mimgdisplay directly (I doubt though that ranger is to blame here).
Following is "taken" from ranger/ext/img_display.py for quick & dirty test.

/usr/lib/w3m/w3mimgdisplay <<<$'0;1;100;100;100;100;;;;;/home/miro/download/_camera/IMG_5816.jpg\n4;\n3;'

Offline

#5 2014-07-22 23:08:40

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: w3m/ranger images don't work on urxvt

I used to use urxvt + ranger and had the same issue you did. Unfortunately I'm not sure I remember how to fix it, but I think it had to do with what font you use for your terminal. Try switching to a more basic or monospaced font, see if that helps. Let me know if it doesn't, I can probably find what it was with a little research.

Offline

#6 2014-07-23 07:04:11

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: w3m/ranger images don't work on urxvt

monodromy wrote:

Not sure if this is helpful, but I couldn't get w3m-img + ranger to work with tmux. When I switched to urxvt-tabbed, everything worked fine.

I've already taken tmux out of the way for now so it doesn't interfere these tests.

WonderWoofy wrote:

The last time I checked, it wasn't rxvt-unicode that supported it, but rather just plain 'ol rxvt.  But you should probably try using tmux since a) it is kick ass, and b) monodromy says it works.

AFAIK, rxvt had issues, which is why I turned to urxvt. I've seen mentions of this working with urxvt; that why I switched to it.
I tried rxvt anyway and it doesn't work either.

Also monodromy just mentioned that he had issues with tmux (and I'm testing all this without tmux, for now).

mkoskar wrote:

Do you mean this (in ~/.config/ranger/rc.conf)?

# Preview images in full color with the external command "w3mimgpreview"?
# This requires the console web browser "w3m" and a supported terminal.
# It has been successfully tested with "xterm" and "urxvt" without tmux.
set preview_images true

I did that and it works as advertised. With up-to-date xterm and rxvt-unicode.
Indeed it doesn't work in tmux but does in screen.

To take ranger out of the picture for debugging you might call w3mimgdisplay directly (I doubt though that ranger is to blame here).
Following is "taken" from ranger/ext/img_display.py for quick & dirty test.

/usr/lib/w3m/w3mimgdisplay <<<$'0;1;100;100;100;100;;;;;/home/miro/download/_camera/IMG_5816.jpg\n4;\n3;'

~/.config/ranger/rc.conf is set properly. It works properly on xterm.

That code snippet works on xterm, does not on urxvt.

PolyBender wrote:

I used to use urxvt + ranger and had the same issue you did. Unfortunately I'm not sure I remember how to fix it, but I think it had to do with what font you use for your terminal. Try switching to a more basic or monospaced font, see if that helps. Let me know if it doesn't, I can probably find what it was with a little research.

I tried setting the font to "Monospace", and got rid of "URxvt.letterSpace" just in case; no change. Can you share your config, and I'll see if it's of any help? Thanks!

Offline

#7 2014-07-23 09:51:34

mar04
Member
From: Poland
Registered: 2010-02-08
Posts: 117

Re: w3m/ranger images don't work on urxvt

I use ranger with w3m previews in urxvt every day. Works fine. In addition to "preview_images" I had to set "draw_borders" to true. You can take a look at my config here: https://github.com/mar04/dotfiles

Offline

#8 2014-07-23 13:26:50

th3voic3
Member
Registered: 2012-03-20
Posts: 92

Re: w3m/ranger images don't work on urxvt

It doesn't work with transparent terminals. I always make a shortcut for a "special ranger terminal" that has transparency disabled.

Offline

#9 2014-07-23 18:30:08

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: w3m/ranger images don't work on urxvt

hobarrera wrote:
PolyBender wrote:

I used to use urxvt + ranger and had the same issue you did. Unfortunately I'm not sure I remember how to fix it, but I think it had to do with what font you use for your terminal. Try switching to a more basic or monospaced font, see if that helps. Let me know if it doesn't, I can probably find what it was with a little research.

I tried setting the font to "Monospace", and got rid of "URxvt.letterSpace" just in case; no change. Can you share your config, and I'll see if it's of any help? Thanks!

Sadly I don't have the config anymore, my old laptop recently died and I'm using a new machine with a fresh install. Check this out though: https://github.com/hut/ranger/issues/86. It seems that the issue has to do with fonts that use anti-aliasing, so you might want to test that out.

I'm almost 95% sure it has to do with your font configurations, it's what my problem was back then. I ended up dropping ranger and keeping the font because I did a lot of programming in vim and really needed a font that I liked.

Offline

#10 2014-07-23 19:23:32

th3voic3
Member
Registered: 2012-03-20
Posts: 92

Re: w3m/ranger images don't work on urxvt

Link to issue on github

Edholm wrote:

I resolved this by removing URxvt.depth: 32 from my .Xdefaults file.

What I used to do to work around this is starting a terminal that is supposed to run ranger with

urxvt -depth 0

Offline

#11 2014-07-23 21:38:33

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: w3m/ranger images don't work on urxvt

th3voic3 wrote:

It doesn't work with transparent terminals. I always make a shortcut for a "special ranger terminal" that has transparency disabled.

Whoops! I had transparency enabled, but I've used i3 for some time now which doesn't support it, so I don't need that!

mar04 wrote:

I use ranger with w3m previews in urxvt every day. Works fine. In addition to "preview_images" I had to set "draw_borders" to true. You can take a look at my config here: https://github.com/mar04/dotfiles

I literally copy-pasted https://github.com/mar04/dotfiles/blob/ … rces/urxvt over my .Xresources, and it worked. I then compared line-by-line and found which was the conflicting value (as mentioned by someone else):

URxvt.depth: 32

(I also stole some of your font settings which I liked! :B )

Images that don't fix in the screen width are shown all screwed up. "set draw_borders" solved this.

---

Font antialising did not interfere with this at all.

Now on to get it working with tmux: is that even possible?

Offline

#12 2018-06-05 08:30:05

dboneham
Member
Registered: 2018-05-14
Posts: 2

Re: w3m/ranger images don't work on urxvt

As a brief postscript to the above as at 5 June 2018, following an upgrade to my system, I found that my rc.conf looked for the preview_scripts file (scope.sh) at ~/.config/renger/ whilst the file was actually packaged at /etc/ranger/data. Updating my rc.conf was the solution that worked for me. I have no idea why my pre-existing rc.conf looked in the wrong place before (but it worked OK bef9re!).

Offline

#13 2018-06-05 08:32:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: w3m/ranger images don't work on urxvt

It's been 4 years a lot can and will have changed, I doubt that your issue was related to the original issue.

Don't necrobump

Closing.

Last edited by V1del (2018-06-05 08:33:16)

Offline

Board footer

Powered by FluxBB