screen-users
[Top][All Lists]
Advanced

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

RE: repainting the screen buffer


From: address@hidden
Subject: RE: repainting the screen buffer
Date: Fri, 23 Mar 2007 09:19:53 +0100 (CET)
User-agent: SquirrelMail/1.4.8

>> Below something I tried using a register (here invoked with Alt-h) This
sort
>> of works, but hardcopy makes you lose the color/bold/etc. information,
>> unfortunately. Still it might be better than nothing and help you
figure out
>> how the 'register' and 'process' commands work.
>>
>> #
>> register H "^A:hardcopy -h $HOME/.screen.hc^M^A:exec
/local/openpkg/bin/head
>> -c -1 $HOME/.screen.hc^M"
>> bindkey ^[h process H
>> #

>I've spent a couple hours trying to make this work.  It seems to me
>that there is a limit on the number of characters one can put in a
>register.

There might be, there definately seems to be a limit to 100 (and less if
the screen is less wide) characters of input on the : line of the
terminal.

>register A "\036:hardcopy -h /tmp/mgrant.screendump\015\036:exec
/home/mgrant/bin/redraw-screen\015"
>What I ended up doing was put the bulk of this into a perl script so
>the register would be short:

>#!/usr/local/bin/perl
>undef $/;
>open(FP,"</tmp/mgrant.screendump");
>print substr(<FP>,0,-1);
>unlink "/tmp/mgrant.screendump";

Another way to tie multiple actions together under one key is by using
'eval', e.g.:

:bindkey -k k9 eval "colon" "stuff foo" "stuff bar"

And when I press the bound key (F9 here) ':foobar' is typed for me.


>You are correct that this looses the color.  Also, any white space at
>the end of the lines!

The output from ':log on' does have all the information needed to repaint
everything. Of course the log file might get a little too big after a
while, so you'd need to truncate it now and then, and make a reasonable
guess of how much to 'play-back' (and no guarantee that some important
escape code (e.g. to switch character set) is cut of at the front).

I tried logging to a named pipe (to have something at the other end do the
buffering and regurgitating), but that didn't seem to work, as screen
tried to seek to the end of the pipe to append more logging..

Pieter






reply via email to

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