Saving/restoring the console cursor position?

Saving/restoring the console cursor position?

Post by Kendall Bennet » Thu, 20 Mar 2003 06:23:39



Hi Guys,

I am trying to find out if it is possible at all to save and restore the
location of the text mode console cursor across graphics modes. Ie: we
switch the console to graphics mode and re-program the hardware, and
then need to restore it again at the end. While in graphics mode we may
well end up actually running in text mode and re-programming the text
mode cursor position, so would like to save and restore the cursor
position across the graphics mode operation.

Presently I cannot figure out a way to do this, so we simply clear the
screen on exit from graphics mode. I would prefer to restore the screen
back to the original state. Does anyone know how to save the console
cursor position? I know how to set it, but I can't figure out how to
save it....

--
Kendall Bennett
Chief Executive Officer
SciTech Software, Inc.
Phone: (530) 894 8400
http://www.scitechsoft.com

~ SciTech SNAP - The future of device driver technology!

 
 
 

Saving/restoring the console cursor position?

Post by Kasper Dupon » Thu, 20 Mar 2003 09:32:20



> Presently I cannot figure out a way to do this, so we simply clear the
> screen on exit from graphics mode. I would prefer to restore the screen
> back to the original state. Does anyone know how to save the console
> cursor position? I know how to set it, but I can't figure out how to
> save it....

You can use /dev/vcsa%d but why do you want to do that at all?
AFAIK the X server doesn't do any such state save and restore,
it just uses a different VC and lets the VC switching code in
the kernel take care of cursor position and screen contents.
But it still does have to take care of screenmode. I believe
you can actually also save and restore cursor position using
IO ports to the gfx board, it might be the prefered appproach
since you are probably already messing around with those.

--
Kasper Dupont -- der bruger for meget tid p? usenet.

for(_=52;_;(_%5)||(_/=5),(_%5)&&(_-=2))putchar(_);

 
 
 

Saving/restoring the console cursor position?

Post by Ulf-Rainer Tiet » Fri, 21 Mar 2003 07:58:53



> Hi Guys,

> I am trying to find out if it is possible at all to save and restore the
> location of the text mode console cursor across graphics modes. Ie: we
> switch the console to graphics mode and re-program the hardware, and
> then need to restore it again at the end. While in graphics mode we may
> well end up actually running in text mode and re-programming the text
> mode cursor position, so would like to save and restore the cursor
> position across the graphics mode operation.

> Presently I cannot figure out a way to do this, so we simply clear the
> screen on exit from graphics mode. I would prefer to restore the screen
> back to the original state. Does anyone know how to save the console
> cursor position? I know how to set it, but I can't figure out how to
> save it....

infocmp -L shows:
restore_cursor=\E8, save_cursor=\E7
I am not sur eif it does what you want, but its a starting point.
I think there is some extended SCO ESC sequences implemented as well, whicxh
might do something like that as well.

ulf