public inbox for blinux-list@redhat.com
 help / color / mirror / Atom feed
From: Nikhil Nair <nn201@cus.cam.ac.uk>
To: Luke Davis <ldavis@dynanet.com>
Cc: blinux-list@redhat.com
Subject: Re: Screen capturing:
Date: Sat, 30 Nov 1996 09:31:20 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.3.95.961130090634.3141A-100000@amasis.trin.cam.ac.uk> (raw)
In-Reply-To: <Pine.BSI.3.95.961130015728.28926A-100000@hyperion.dynanet.com>

On Sat, 30 Nov 1996, Luke Davis wrote:

> Ok, I'm running a few consoles, and a terminal . . .
> [...]
> Fine, but that's not what I wanted . . .
> 
> What I want, is to be able to copy what's already on the console/terminal
> screen, to a terminal/file/console.
> 
> Can that be done?

Yes.  Unfortunately, it's very operating system dependent.  What follows
works only on Linux, and requires kernel 1.1.92 or later.

There are some devices called /dev/vcs* and /dev/vcsa*.  The numbers after
those prefices are 0 or none for current VC, or any other number for that
number VC, i.e. /dev/vcsa or /dev/vcsa0 uses the current VC, /dev/vcsa3
uses VC 3.

the vcs versions are the simplest.  If you don't have them, then as root
you could type:

mknod -m o= /dev/vcs$n c 7 $n
chown root.tty /dev/vcs$n
chmod 660 /dev/vcs$n

where $n is between 0 and 63.

The vcs devices contain one character per screen position, going in the
order you'd expect (left to right then top to bottom).

WARNING: these devices may not use the character set you expect!  BEcause
of a quirk in Linux, chances are you won't be able to recover accent signs
correctly, without some manual translation, anyway.

The vcsa devices are more powerful, in that they give screen size, cursor
position and attribute information.  They also take more interpreting, of
course.

To create them, simply add 128 to the minor device number of the
corresponding vcs device, i.e.

mknod -m o= /dev/vcsa$n c 7 $[n+128]
chown root.tty /dev/vcsa$n
chmod 660 /dev/vcsa$n

If you want to know about the file format, and if you can't find the
documentation, ask me.  For some sample code using it, you could look at
the LiveScreen class in scrdev.cc from brltty-1.0.2:
   ftp://sunsite.unc.edu/pub/Linux/system/Access/brltty-1.0.2.tar.gz

I didn't know about setterm until just now, but remember that, unless the
last octal digit of your umask is 7 (which it wouldn't normally be), using
this is a potential security hole, as other users could read the contents
of the console through the contents of that file.  Use that with care!

Hope this helps,

Nikhil.

--
Nikhil Nair
Trinity College, Cambridge, England
Tel.: +44 1223 368353
Email: nn201@cus.cam.ac.uk
       nnair@debian.org




  reply	other threads:[~ UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
 Luke Davis
 ` Nikhil Nair [this message]
   ` AARON HOWELL
     ` site report William Loughborough
   ` Screen capturing: Jim Van Zandt
 ` Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.95.961130090634.3141A-100000@amasis.trin.cam.ac.uk \
    --to=nn201@cus.cam.ac.uk \
    --cc=blinux-list@redhat.com \
    --cc=ldavis@dynanet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).