For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > July 2007 > Grab piece of text from console and put in a buffer with console-codes?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Grab piece of text from console and put in a buffer with console-codes?
Pim

2007-07-23, 4:13 am

Hi everybody.

I am writing a library in many langages that will
define objects and manipulate them in many ways.

This library must use most of the tricks existing
in the console codes.
eg : specials charaters sequences that can

- modify console display,
- change positions where to write.
- change colors and background, etc...

In the console-code manual i did not find
a way to grab an piece (a zone) of text
when it is displayed, and this should be
very usefull for my library, is there
one?

If there is not, whitch command or unix
tricks?

I am playing with Linux Debian.

Thank's in advance.

Pim.
Pim

2007-07-23, 4:13 am

Le 23 Jul 2007 08:45:38 GMT,
Pim <moi@free.fr> disait ceci :
> Hi everybody.
>
> I am writing a library in many langages that will
> define objects and manipulate them in many ways.
>
> This library must use most of the tricks existing
> in the console codes.
> eg : specials charaters sequences that can
>
> - modify console display,
> - change positions where to write.
> - change colors and background, etc...
>
> In the console-code manual i did not find
> a way to grab an piece (a zone) of text
> when it is displayed, and this should be
> very usefull for my library, is there
> one?
>
> If there is not, whitch command or unix
> tricks?
>
> I am playing with Linux Debian.
>
> Thank's in advance.
>
> Pim.

I need to specify that my library is a for
"drawing" in text mode on console,
windows with simple or double borders,
text zones, colored characters, etc....
not a pixelized drawing library.
Thank you.
Alan Curry

2007-07-23, 7:08 pm

In article <slrnfa8qt5.3lr.moi@Msrv.mydomain.net>,
Pim <pim.mouss@free.fr> wrote:
>Hi everybody.
>
>In the console-code manual i did not find
>a way to grab an piece (a zone) of text
>when it is displayed, and this should be
>very usefull for my library, is there
>one?


On most terminal types it's not possible to read back from the screen. If you
use curses you can read back what you printed with the inch(3) family of
functions.

>I am playing with Linux Debian.


The vcs(4) devices may be what you're looking for. Reading /dev/vcs1 tells
you what's currently displayed on /dev/tty1.

--
Alan Curry
pacman@world.std.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com