Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

save & restore cursor position in perl
I'm trying to save and restore the current position of the console's
cursor in perl on FreeBSD 4.10 using the escape sequences without
success, FreeBSD do not seems to support it.

sub savecursorpos
{
print "\x1B[sm";
}

sub restorecusorpos
{
print "\x1B[um";
}

I also tried:

sub savecursorpos
{
print "\x1B7m";
}

sub restorecusorpos
{
print "\x1B8m";
}

even tput do not work:

print `tput sc`;    # Get the code to save the current cursor position
print `tput rc`;

Is there a way to do this using termcap or terminfo ? or any other
functions?

Report this thread to moderator Post Follow-up to this message
Old Post
someone92
12-26-04 02:01 AM


Re: save & restore cursor position in perl
someone92 wrote:
> I'm trying to save and restore the current position of the console's
> cursor in perl on FreeBSD 4.10 using the escape sequences without
> success, FreeBSD do not seems to support it.

When talking about cursor positions usually the Curses module is the answer.
Did you check it already?

jue



Report this thread to moderator Post Follow-up to this message
Old Post
Jürgen Exner
12-26-04 02:01 AM


Re: save & restore cursor position in perl
someone92 wrote:
> I'm trying to save and restore the current position of the console's
> cursor in perl on FreeBSD 4.10 using the escape sequences without
> success, FreeBSD do not seems to support it.
>
> sub savecursorpos   { print "\x1B7m"; }
> sub restorecusorpos { print "\x1B8m"; }

That should be "\x1B7" and "\x1B8" (no "m" here).
Don't forget "\x1B[6n".  http://www.inwap.com/pdp10/ansicode.txt

The `resize` program uses those escape sequences.
linux% script
Script started, file is typescript
% /usr/X11R6/bin/resize
% exit
linux% od -d typescript

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Smith
12-29-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:33 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.