Creating HTML Screenshots

XTerm lets you customize a print command via its printerCommand resource. Additionally, via printAttributes one can control which control sequences are passed to / filtered for the printer command. Having seen this some week-end without net access, I hacked a perl script which reads XTerm's fully attributed input and converts it to HTML. Since the input is regular and does not abuse the control sequence, this is actually quite easy. The ugliest part is the support for the linedrawing characters which XTerm provides via a special font and a font switching directive; not all the line-drawing characters have corresponding HTML entities.

I discovered the Monday after the week-end, that the idea was not new and there are some hacks out there with similar functionality (cf. Google:ctlseqs2html.pl).

Page XTerminalEmulator
Revision 15 Apr 2004
Parents: Index