Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Resetting your Terminal for each line printed

by liverpole (Monsignor)
on Sep 27, 2006 at 11:02 UTC ( #575125=note: print w/replies, xml ) Need Help??

in reply to Resetting your Terminal for each line printed

Hi ghenry,

From your question:

    (by adding print ' ' x 80;)

it looks like you mean you wish to clear to the end of the line, is that correct?

If so, use <escape>[K like so:

print "\e[K";

Some of the escape sequences I use all the time are:

print "\e[H"; # Put the cursor on the first line print "\e[J"; # Clear from cursor to end of screen print "\e[H\e[J"; # Clear entire screen (just a combination +of the above) print "\e[K"; # Clear to end of current line (as stated +previously) print "\e[m"; # Turn off character attributes (eg. color +s) printf "\e[%dm", $N; # Set color to $N (for values of 30-37, or + 100-107) printf "\e[%d;%dH", $R, $C; # Put cursor at row $R, column $C (good fo +r "drawing")


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575125]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-03-22 22:26 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.