w3m images (ranger) display in terminal #6387

Closed
opened 2026-01-31 00:37:17 +00:00 by claunia · 5 comments
Owner

Originally created by @zyy1998 on GitHub (Feb 12, 2020).

Originally assigned to: @DHowett-MSFT on GitHub.

Display images in terminal

I'm trying to use WSL to substitute some functions on windows, it performed well in some text-only functions. But I'm also want to use ranger ( a linux terminal file explorer ) to replace totalcommander which I often used or even windows file explorer, ranger satisfies my content in many occasions but for image preview.

w3m is a terminal web browser that could be used to display images in terminal, and it can also be used by ranger. However, w3m didn't work on this terminal.

There are many other terminals like iTerm2urxvt and alacritty could display images. As a terminal under windows, I think it's more necessary to support this feature.

Proposed technical implementation details

I don't know how does w3m works, but I have noticed that the terminal could be changed the background pictures, so if you want to render some images, you can just change the specific area of the background of the terminal. Actually it's how urxvt handled it.

Of course, you don't have to support w3m, just do something that could display images correctly and the method could be called by other apps like ranger, that's all what I need.

Thanks! ( And pardon for my poor English😁 )

You can find more information here: https://github.com/ranger/ranger/wiki/Image-Previews

Originally created by @zyy1998 on GitHub (Feb 12, 2020). Originally assigned to: @DHowett-MSFT on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Display images in terminal I'm trying to use **_WSL_** to substitute some functions on windows, it performed well in some text-only functions. But I'm also want to use **_ranger_** ( a linux terminal file explorer ) to replace **_totalcommander_** which I often used or even **_windows file explorer_**, **_ranger_** satisfies my content in many occasions but for image preview. **_w3m_** is a terminal web browser that could be used to display images in terminal, and it can also be used by **_ranger_**. However, **_w3m_** didn't work on this terminal. There are many other terminals like **_iTerm2_**、**_urxvt_** and **_alacritty_** could display images. As a terminal under windows, I think it's more necessary to support this feature. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details I don't know how does w3m works, but I have noticed that the terminal could be changed the background pictures, so if you want to render some images, you can just change the specific area of the background of the terminal. Actually it's how **_urxvt_** handled it. Of course, you don't have to support w3m, just do something that could display images correctly and the method could be called by other apps like **_ranger_**, that's all what I need. Thanks! ( And pardon for my poor English😁 ) You can find more information here: https://github.com/ranger/ranger/wiki/Image-Previews <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 00:37:17 +00:00
Author
Owner

@jantari commented on GitHub (Feb 12, 2020):

Have you tried with überzug ? It's the recommended way to get image previews in ranger, w3m is always wonky even when you do get it to work on native Linux.

Also, if you just want something ranger-like on Windows you don't have to use WSL, you can just use lf which runs on Windows (and Linux) natively and is much faster too. But it has no option to do image previews.

EDIT: I couldn't curb my curiosity so tried ueberzug on WSL2 myself and ran into a problem I could not fix: https://github.com/seebye/ueberzug/issues/87 let me know if you can figure it out

@jantari commented on GitHub (Feb 12, 2020): Have you tried with [überzug](https://github.com/seebye/ueberzug) ? It's the recommended way to get image previews in ranger, w3m is always wonky even when you do get it to work on native Linux. Also, if you just want something ranger-like on Windows you don't have to use WSL, you can just use [lf](https://github.com/gokcehan/lf) which runs on Windows (and Linux) natively and is much faster too. But it has no option to do image previews. EDIT: I couldn't curb my curiosity so tried ueberzug on WSL2 myself and ran into a problem I could not fix: https://github.com/seebye/ueberzug/issues/87 let me know if you can figure it out
Author
Owner

@akho commented on GitHub (May 9, 2020):

w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves.

Having some way to draw images in terminal would be very nice though. Kitty, for example, implements its own thing (icat), and integrates well with ranger. Would be lovely to have that in Terminal.

Sixel or whatever iTerm2 does are also nice, I think Sixel support is in the pipeline? Not supported by ranger yet, though.

@akho commented on GitHub (May 9, 2020): w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves. Having some way to draw images in terminal would be very nice though. Kitty, for example, implements its own thing (icat), and integrates well with ranger. Would be lovely to have that in Terminal. Sixel or whatever iTerm2 does are also nice, I think Sixel support is in the pipeline? Not supported by ranger yet, though.
Author
Owner

@j4james commented on GitHub (May 10, 2020):

FYI, there are separate issues for Sixel (#448), and the other proprietary image formats (#5746).

@j4james commented on GitHub (May 10, 2020): FYI, there are separate issues for Sixel (#448), and the other proprietary image formats (#5746).
Author
Owner

@DHowett-MSFT commented on GitHub (May 11, 2020):

Thanks for the request here. I'm going to make /dup #5746 the master issue for graphics-in-the-terminal and copy your comments over there.

At the end of the day, if other terminals are doing this in a standards-compliant, secure and portable way... we should consider following suit.

@DHowett-MSFT commented on GitHub (May 11, 2020): Thanks for the request here. I'm going to make /dup #5746 the master issue for graphics-in-the-terminal and copy your comments over there. At the end of the day, if other terminals are doing this _in a standards-compliant, secure and portable way_... we should _consider_ following suit.
Author
Owner

@ghost commented on GitHub (May 11, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (May 11, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6387