screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [screen-devel] screendump to png


From: Micah Cowan
Subject: Re: [screen-devel] screendump to png
Date: Mon, 25 Jun 2007 13:11:00 -0700
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

Folkert van Heusden wrote:
> Hi,
> 
> Thanks for the reply.
> 
>>> It would be nice if something got added to screen so that it can write
>>> screendumps to a .png-file. As far as i know it can currently only write
>>> ascii black&white dumps to a textfile.
>> I don't think that's really within the scope of what screen does. The
>> standard way to do this, though, is to do a screenshot of the terminal
>> window within which screen is running. Are you unable to do this?
> 
> Ah no, not always. Quite often I'm running screen directly on the
> console without any X around it.
> My idea of screen is to enable users to everything on a console (e.g.
> multiple 'virtual terminals') which can be done via X, so that includes
> screendumps (in color).

Gotcha. Of course, you could detach the session and reattach from within
an X terminal; but that sort of defeats your purpose.

I still feel that this should be a separate utility--not the least
because it could then be used with other programs besides vim.
Basically, it could be a vt100-style "terminal emulator" whose output
device is a PNG file. :) You could obtain a typescript from the "script"
program, and feed that to the PNG generator, and: presto!

Sounds like a fun project, and maybe I'd be willing to work on it at
some point; but I think the demand for such a tool would be extremely low.

If all you want to do is share your screen output with someone else, you
should use the "log" command (Ctrl-A H). This produces output just like
typescript's, including escape sequences and everything; but with the
advantage that you can turn it off instantly, without having to spoil
the screen state first. You can then cat the contents of this file to
get a copy of the screen at the last state.

Note that this is still heavily terminal-dependent; in particular, if
the terminal's width and height are different and the screen was
displaying some ncurses-based program (such as vim), you're likely to
get unpleasant results when catting it back out.

Assuming you want to get a screenful of an ncurses-based program, and
the user you're sharing with has their terminal set up similarly to
yours, you can:

1. Get your screen session to the desired state.
2. Activate logging (Ctrl-A H)
3. Tell the application to redraw (Ctrl-L, in vim, for example)
4. Deactivate logging (Ctrl-A H)
5. cat the screenlog.0 file.

Alternatively, if you don't have a redraw function in the program, or
you're just running a shell session or similar, you can just start
logging as the very first thing, then hit return (so the prompt is drawn
after logging starts), and proceed normally.

Ideally, if someone writes a escape-sequences-to-PNG program, it could
just slurp that file right in (with some necessary additional
information about terminal type, and numbers of cols and rows). In the
meantime, you can ask your friends to cat the file, or less -r it.

-- 
HTH,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]