
PDF viewer that works inside terminals that support inline graphics - gnocchi
https://github.com/dsanson/termpdf
======
tlack
If 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/PJzHw...](https://groups.google.com/forum/#!topic/iterm2-discuss/PJzHwRMOWK4)

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)

------
truncate
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
The 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_
It'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/d286acbf58b72d05a55453c134...](https://github.com/shinh/w3m/blob/d286acbf58b72d05a55453c134216d63273f3b63/w3mimg/x11/x11_w3mimg.c#L778-L806)

~~~
IgorPartola
After reading your comment all I can think of is: this is why we can't have
nice things.

~~~
iso-8859-1
notty will support doing this cleanly in the future:
[https://github.com/withoutboats/notty](https://github.com/withoutboats/notty)

------
cm3
I 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.

------
rekado
I 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.

------
cyphar
I'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).

------
chris-at
Would this work via ssh as well?

------
jkot
More useful would be text based PDF viewer.

~~~
morsch
Or a PDF based terminal emulator?

