You are not logged in.
Pages: 1
Topic closed
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
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
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
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
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
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.
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).
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.
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
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
It doesn't work with transparent terminals. I always make a shortcut for a "special ranger terminal" that has transparency disabled.
Offline
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
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
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!
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
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
It's been 4 years a lot can and will have changed, I doubt that your issue was related to the original issue.
Closing.
Last edited by V1del (2018-06-05 08:33:16)
Offline
Pages: 1
Topic closed