Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Inserting a little life to my output

by hotshot (Prior)
on Dec 17, 2002 at 14:49 UTC ( [id://220532]=note: print w/replies, xml ) Need Help??


in reply to Re: Inserting a little life to my output
in thread Inserting a little life to my output

thanks a lot it will sure help. just one thing, can you explain what you did in case $is_prompt is true, and the last line before the return statement?

Hotshot
  • Comment on Re: Re: Inserting a little life to my output

Replies are listed 'Best First'.
Re: Re: Re: Inserting a little life to my output
by dempa (Friar) on Dec 17, 2002 at 15:04 UTC

    Sure hotshot (if I remember what I did, that is :) ).

    When I made this subroutine and used the output for a colorful prompt (with Term::ReadLine), the color codes (the real ones, from Term::ANSIColor) confused the readline-prompt. In short, it counted the "invisible" color codes as characters and inserted the newline (which should come at the end of the terminal window) too early. To avoid this I inserted some extra control characters around the color codes to avoid it being counted by ReadLine.

    The last line before the return statement is for converting %% to %. That means: Use %% in colorparse() to output a literal %.

    -- 
    dempa

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found