From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 7370 invoked from network); 30 Nov 1996 09:34:18 -0000 Received: from ursa.cus.cam.ac.uk (cusexim@131.111.8.6) by mail2.redhat.com with SMTP; 30 Nov 1996 09:34:18 -0000 Received: from nn201 by ursa.cus.cam.ac.uk with local (Exim 1.59 #1) id 0vTloA-0002Id-00; Sat, 30 Nov 1996 09:34:02 +0000 Date: Sat, 30 Nov 1996 09:31:20 +0000 (GMT) From: Nikhil Nair X-Sender: nn201@amasis.trin.cam.ac.uk To: Luke Davis cc: blinux-list@redhat.com Subject: Re: Screen capturing: In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: 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