Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would I get row and column of current cursor position in termial

Status
Not open for further replies.

DotSlashJames

Programmer
Mar 11, 2005
7
0
0
US
Hey,

I used Term::Screen to write a little status bar module. But it will only work correctly for my needs if I can pass it the row and column of the current cursor position on the terminal. I played around with Curses getyx() function, but it just did not seem to do what I want.

Basically I am looping through a bunch of tests and I want to have a progress bar for each test... i.e.:

test001... |==========| 100%
test002... |==== | 40%

I basically want to use print and printf as normal and to somehow get the row and column of the cursor after the print statement is completed.

print "test001... ";

-- OUTPUT --

test001... *

I want to get the row and column of where the * is (which is where the cursor would be after the above print statement).

Any ideas? Thanks.

./james


BTW... I have tried Term::Status bar and Term::progress bar and for the life of me I cannot get them to print output to the terminal in the location I want and the fashion I want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top