[comp.sys.hp] screen print

fgg@gemini.gsfc.nasa.gov (Frank G. Gomez) (06/19/91)

Hello,
   Quick question -- Is there any way to send a
   screen image to the printer ?  The terminal type
   is HP 98785A (TERM=300h).  It doesn't seem to have
   the 'mc0' terminfo capability like the HP 2393A.
Thanks.  E-mail is welcome.

paul@prcrs.prc.com (Paul Hite) (06/27/91)

In article <5736@dftsrv.gsfc.nasa.gov>, fgg@gemini.gsfc.nasa.gov (Frank G. Gomez) writes:
>    Quick question -- Is there any way to send a screen image to the printer ?

I have a program called readscreen that can do just that.  Frank has been 
testing it.  readscreen has been in operation here at prc for over a year.
Despite that it did crash and burn when Frank first tested it.  With some
help from Frank, it is now more robust.  Soon I will donate it to the public
domain.  But first I would like to find a *few* beta sites to test it a
bit more.  If you would like to help me test it, send me email.  Here is
a quick description:

readscreen is a utility that can read the terminal memory of an HP terminal 
and copy it to a file or pipe it to a program.  The usual invocation consists
of  something like "readscreen > file" or "readscreen | lp".  readscreen 
wants its standard output connected to something besides a tty and it will
complain if this is not the case.  This prevents a command like "readscreen"
from trashing the terminal's memory.

Display functions mode and insert character mode must be disabled when
readscreen is run.  This is the responsibility of the user.  readscreen will
not disable these modes for you.

By default, readscreen will read all of the terminal's memory, which can be
several hundred lines.  I usually use the terminal's editing keys to review
memory and delete any lines that I don't want.  But "-s" can be used to 
limit readscreen to just the current screen.  Or "-l count" can be used to
limit readscreen to "count" number of lines.

The escape sequences that readscreen uses can wreck havoc with non-HP
terminals.  So readscreen checks the TERM environment variable.  This must
be set to a value that starts with "hp" or "HP".  Or the value of TERM 
must be present in a table internal to readscreen.  This table currently
contains every name for any hp terminal that I could find.  It may be
necessary to add or remove entries to this table when you build readscreen.
In any case "-f" disables the TERM check.

Acknowledgement: I first became aware that this sort of thing was possible
by observing the behavior of a program called edit/1000 on an RTE system.
I studied the operation of edit/1000 with a data monitor to determine the 
escape sequences needed.

Paul Hite   PRC Realty Systems  McLean,Va   paul@prcrs.prc.com    (703) 556-2243
    "We are trying to bring up an Air Traffic Control display on an X window 
      terminal and there seems to be some problems." -- from comp.windows.x