[Top][All Lists]

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

Re: scripting screen windowlist?

From: Rui Guo
Subject: Re: scripting screen windowlist?
Date: Tue, 09 Jun 2009 00:59:46 +0800

I'm working on providing scripting support to screen. This will be easy
with the embedded script, since some of the internal statuses of screen
are exposed. But I'm afraid it still need some time to be stabilize and
will not be available until (at least) the next release.

On Sun, 2009-06-07 at 07:03 -0700, Gerald Young wrote:
> Brian Kroth wrote:
> > Is there a way to dump the
> > output of "windowlist" to a file, or some other mechanism that I could
> > get at this data?  I've tried with logging and hardcopy but they both
> > dump the underlying window contents.
> > 
> You could nest that screen session inside another screen session.
> Let's call the session you already have "old" and the other "new".
> You would first detach from "old" then do:
> screen -e'^Ss' -mS new screen -r old
> The useful thing about a nested screen session is that the ouput of
> "old" session will be the input of "new", and therefore it will end up in
> the display/scrollback buffer of it.
> So if you bring the windowlist for "old" and do a "hardcopy" on "new",
> it will capture the windowlist.
> There's another problem though, if you try to do bring the windowlist
> and then do a hardcopy from a single screen script the windowlist
> wont appear quickly enough and hardcopy will capture the underlying
> window instead.
> There needs to be a wait between sending th command to bring up
> the windowlist and doing "hardcopy". "sleep" doesnt work when
> "source"ing screen scripts. So I split the script in two and used
> "idle" instead:
> So screen_script_1 would be:
> stuff "^A\""
> idle 1 source "/home/gerald/screenrc.d/screen_script_1"
> And screen_script_2:
> hardcopy "/home/gerald/screenrc.d/dumpwinlist"
> idle 0
> stuff "^["
> Another way would be to do the commands from bash (using
> screen -X), and use the "sleep" command it has instead.

reply via email to

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