Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-02-14 04:47 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (457 votes), past polls