8 ms·
PDF viewer that works inside terminals that support inline graphics
- cyphar 11y agoI'll check this when I get back on my Linux machine, but has anyone tried this in Termite (or Gnome Terminal since they use essentially the same terminal library).
- truncate 11y agoCoincidentally, 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...
- tlack 11y agoIf anyone is as curious about how this works as I am, here's some info from the source: https://github.com/dsanson/termpdf/blob/master/termpdf#L71 https://github.com/dsanson/termpdf/blob/master/termpdf#L71 Some notes on Tmux's support: https://groups.google.com/forum/#!topic/iterm2-discuss/PJzHwRMOWK4 https://groups.google.com/forum/#!topic/iterm2-discuss/PJzHw... Here are some other weird extended escape codes supported by iTerm on Mac, such as notifications and setting clipboard contents: https://www.iterm2.com/documentation-escape-codes.html https://www.iterm2.com/documentation-escape-codes.html
- deleted 11y ago[deleted]
- chris-at 11y agoWould this work via ssh as well?
- rekado 11y agoI find it interesting that the screenshot resembles my Emacs session. Personally, I find terminal emulators to be a worse target for PDF viewers than Emacs buffers.
- jkot 11y agoMore useful would be text based PDF viewer.
- morsch 11y agoOr a PDF based terminal emulator?
- cm3 11y agoI really wish devdraw would get real Plan9 behavior and 9term would gain readline-style interaction such that they would allow us to transition to a rich terminal which can host text and graphics natively. I know there are some hacks like this one or Terminology (Enlightenment project), but those are still hacks. If you've ever used a native Plan9 environment where running a graphical application from within a shell transforms the shell into the graphical application, you know what I mean. It's very natural to lose the distinction. Yes, there are some hacks and closed applications that do some of this, but those cannot be used universally. Sadly plan9port and their devdraw and drawterm create a separate window and do not transform the terminal.
- deleted 11y ago[deleted]