[Top][All Lists]

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

Re: screendump of screen

From: Juergen Weigert
Subject: Re: screendump of screen
Date: Fri, 10 Jun 2005 11:47:37 +0200
User-agent: Mutt/

On Jun 10, 05 10:22:35 +1000, foo bar wrote:
> Hi everyone,
> Is there an application that can attach to a screen session, reads
> what the screen looks like, and dumps it to an image (png) ?

Not yet, but you are going to create one, right?

> Is this possible ? Can anyone explain how screen internally works ?
> All I know is (which can be totally wrong) that it communicates using
> named pipes and doesn't use (n)curses.

Forget about the named pipes. This is by far the most frequently heard 
Myth about screen, and it is entirly untrue. People like to say that screen
communicates via pipes or sockets with the terminal it is attached to.
In reality, screen simply opens the terminal device and writes to it.

> But what is being communicated on those pipes ? or it doesn't use them
> altogether ? What about ptys ?

A pipe exists in the /tmp area to send a few commands when attaching.
PTYs are heavily used. Whenever one process needs to capture the I/O of
another console based process, a PTY is used. Same trick that xterm does.

> A little background note,
> I've just finished rewriting and improving an application that dumps a
> system's virtual console to a png file. The idea is, you start up
> top/iptraf on the console, and you can watch it over the web. Main
> problem is I couldn't figure out how to interact with the console over
> the web (ie. stop iptraf and start top etc). ttysnoop seems to do
> this, but compilation fails on my machine, and screen seems to be a
> more elegant choice.

How about running screen with -L and parse the logfile to get the 
iptraf output? You can even truncate the logfile after every read, 
if you like.


 o \  Juergen Weigert      unix-software __/ _=======.=======_     
<V> | address@hidden         creator    __/        _---|____________\/    
 \  |            0179/2069677      __/          (____/            /\
(/) | ____________________________/              _/ \_ vim:set sw=2 wm=8

reply via email to

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