print "^[[K";
(that's "ESC[K") will clear from the current curson position until end of line.
Update: Yes, tye, directly cut and pasting the above will not work (hence the added description of "that's 'ESC[K'") (it was embedded as an ESCAPE using my text editor). To get an ESCAPE in Perl, you'll need to use "\e".
| [reply] [d/l] [select] |
print "^[[K";
gives me:
^[[K
perhaps you meant:
print "\c[[K";
# or
print "\e[K";
but be aware that those will only work for ANSI-ish terminals (which are pretty common, though).
-
tye
(but my friends call me "Tye") | [reply] [d/l] [select] |
That's exactly what I'm looking for. I guess that explains all the weird ^[[D type output when pressing the cursor keys without anything tied to stdin.
I have a couple questions though... how compatible is this escape sequence? I am targeting as many POSIX compatible machines as possible. I would use Term::Cap, but I know that many systems are phasing out termcap completely, including Debian GNU/Linux and AIX. Obviously it would be better to find out the exact character that the term expects based on it's TERM type, but termcap is the only mechanism I know for doing as such.
Also, is there a full list of all the possible escape characters like this one?
Thanks,
Nicodemus
| [reply] |
| [reply] |
Have you looked into using Term::Readline? This is a platform independent way of playing with input text.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
| [reply] |
Actually I'm already using Term::ReadLine::Gnu. My whole
app is based around it actually. However, my problem is
with output, not input.
Thanks,
Nicodemus
| [reply] |