Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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")


Comment on Re: Resetting your Terminal for each line printed
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575125]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2015-10-13 14:12 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (307 votes), past polls