views:

156

answers:

3

No, not ASCII graphics, see the screenshot here:

http://en.wikipedia.org/wiki/W3m

How is that even possible?

I checked the source and it only prints character sequences. However, I am unable to find any reference to graphic drawing or image embedding escape sequences in xterm documentation or elsewhere.

w3m also seems to be the only software doing this.

There are vector graphics in Tektronix emulation, but this is done in VT mode.

Maybe I am looking for the wrong thing?

Any idea?

+3  A: 

It's a cheat.

Note that this feature works only in "supported terminals" -- and by that it meant xterm, and rendering directly on the xterm window via xv.

Or not! Just checked the sources, the file that interests us is here. It's still a hack -- via X11 and GTK!

Kornel Kisielewicz
That page is awful, it is 1995 again! :) While w3m has an option to display through xv I don't think the two are related. I don't even have an xv package.
jbcreix
@jbcreix : yeah, had the same '95 feeling ;> -- From the w3m page - Q : How do I change the default image viewer?A : By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.mailcap or /etc/mailcap.Check your viewer!
Kornel Kisielewicz
@jbcreix : "use the source Luke" -- found it ;>
Kornel Kisielewicz
Oh, it was writing its own "w3m image protocol". That's what you get reading a file with no comments. Interesting, but in the end it's just a hack. :(
jbcreix
A: 

Higher-end models of Dec VT terminals support ReGis and Sixel graphics commands. If the xterm emulation is good enough, maybe that's how it was done?

Jim Lewis
xterm doesn't seem to support these modes. At least all references I found were to them not working.
jbcreix
A: 

Is it still the same hack ?

I looked the source file linked, and I saw some Imlib functions that seem to do the trick (if IMLIB is defined for instance). Can you please correct me ? I'm curious and I would like to reproduce the same behavior myself.

http://w3m.cvs.sourceforge.net/viewvc/w3m/w3m/w3mimg/x11/x11_w3mimg.c?view=markup

Thank you very much.

talas