5 ms·
Coincidentally, just today my friend was talking about terminal based browser, and I opened w3m, only to discover that it displays images now. I still couldn't
by truncate 11y ago
Coincidentally, just today my friend was talking about terminal based browser, and I opened w3m, only to discover that it displays images now. I still couldn't figure out how it does that, so thought I might as well just ask here as it seems to be doing something similar here.
- dsp1234 11y agoThe FAQ[0] says it uses xv to display images. My guess would be that w3m generates a borderless X window running xv set to run on top, then manipulates that window to follow the scroll behavior. [0] - http://w3m.sourceforge.net/FAQ http://w3m.sourceforge.net/FAQ
- Jasper_ 11y agoIt's even sillier than that. It just retrieves the terminal window with XGetInputFocus, and then stomps on top of another client's window, along with a pile of heuristics to prevent drawing on top of tabs, scrollbars, etc. https://github.com/shinh/w3m/blob/d286acbf58b72d05a55453c134216d63273f3b63/w3mimg/x11/x11_w3mimg.c#L778-L806 https://github.com/shinh/w3m/blob/d286acbf58b72d05a55453c134...
- IgorPartola 11y agoAfter reading your comment all I can think of is: this is why we can't have nice things.
- iso-8859-1 11y agonotty will support doing this cleanly in the future: https://github.com/withoutboats/notty https://github.com/withoutboats/notty
- truncate 11y agoThat's one of the craziest hack I've seen in while to get stuff done! And this kind of makes me happy.
- cyphar 11y agoYes, that is horrible. But also goddamn awesome. Sure, I'd never think of doing something similar where it was critical, but you've got to admit that is a fairly clever hack.
- YeGoblynQueenne 11y ago>>I opened w3m, only to discover that it displays images now. I distinctly remember Links displaying images back in 2011. Now that I think of it, at the same time I was also reading pdfs and watching movies on the framebuffer... probably. I had a bit of a situation with my hardware, so I had to spend three months in runlevel 3 on Fedora... 12, I think? Och, aye, there's even visual evidence of such: http://www.goblinopera.com/mathemagics/?p=308 http://www.goblinopera.com/mathemagics/?p=308 I still don't know what exactly happened back then but I watched the entire ST:TNG in the terminal. X11 wouldn't start, so that's gotta be the framebuffer, right?
- baldfat 11y agow3m has had image support since at least 2001. "By default w3m uses xv to view images" - https://web.archive.org/web/20011219063714/http://w3m.sourceforge.net/FAQ https://web.archive.org/web/20011219063714/http://w3m.source... December 2001
- digi_owl 11y agoOn that note, i recently learned that back in the day DEC introduced two formats for doing in terminal graphics. ReGIS[0] for vector graphics, and Sixel[1] for bitmap graphics. Also, here[2] is a encoder/decoder for the latter. [0]https://en.wikipedia.org/wiki/ReGIS https://en.wikipedia.org/wiki/ReGIS [1]https://en.wikipedia.org/wiki/Sixel https://en.wikipedia.org/wiki/Sixel [2]https://github.com/saitoha/libsixel https://github.com/saitoha/libsixel
- david-given 11y agoSixel support is slowly making its way out in some terminals --- xterm has support, but it's not compiled in by default, at least not in the version of Debian I've got here. (I've never seen any terminals with Regis support.) It'd be really nice if it would show up soon; there's a number of cool things I want to do with it. However, xterms have supported TEK 4010 graphics support for years. It works really well --- unfortunately the TEK 4010 was a vector storage scope device, with no video framebuffer; it literally drew lines on a phosphor screen using an electron gun, and so cannot draw in black. It's surprisingly limiting. http://use.perl.org/use.perl.org/_scrottie/journal/39195.html http://use.perl.org/use.perl.org/_scrottie/journal/39195.htm...