|new()||Creates a new Term::ScreenColor object. Note that the constructor of the inherited class Term::Screen homes the cursor and switches the terminal to raw input mode.|
Returns (if called with no arguments) or sets (if called with one
boolean argument) whether the terminal is believed to support ANSI
color codes. If this is set to false, no ANSI codes will be printed
or generated. This provides an easy way for turning color on/off.
Note that the constructor above takes an initial guess at whether the terminal supports color (based on the value of the TERM environment variable).
Prints an ANSI escape sequence for a specific color.
The color names understood are:
Additionally, the following names are understood (inherited from Term::Screen):
These termcap names send termcap-based escapes, which are not considered colors and can therefore not be turned off by colorizable().
As of version 1.12, underline() is termcap-based instead of ANSI-based.
Creates a string containing the escape codes corresponding to the
color names or numbers given.
If the terminal is considered to be colorizable, This method will translate any termcap-names to their ANSI equivalents. This algorithm was chosen to improve performance.
If the terminal is not colorizable, the ANSI names are discarded and only the termcap-names are respected. They will send the escape sequences as defined in the termcap database.
|color($colorstring)||(Deprecated). Identical to putcolor($colorstring).|
|putcolor($colorstring)||Prints the escape sequence corresponding to this color string, in other words: the escape sequence that color2esc() generates.|
Returns a string containing a concatenation of the string parts,
wrapped in ANSI color sequences, using the first argument as
Identical to puts(), but wraps its arguments in ANSI color
sequences first, using the first argument as color specification.
As of version 1.11, Term::ScreenColor is bundled with some bugfixes, enhancements and convenience functions that should have gone in Term::Screen. They are therefore contained in a separate package Term::Screen::Fixes.
Term::Screen::Fixes offers the following methods:
new() Creates a new object. Initializes a timeout property, used for keys that generate escape sequences. timeout() timeout($float) Returns (if called with no arguments) or sets (if called with one float argument) the function key timeout. getch() This duplicates the functionality of Term::Screen::getch(), but makes the following improvements:
o getc() was replaced by sysread(). Since getc() does internal buffering, it does not work well with select(). This led in certain cases to the application not receiving input as soon as it was available. o If the received character(s) started off as a possible function key escape sequence, but turn out not to be one after all, then the keys are put back in the input buffer in the correct order. (Term::Screen::getch() put them back at the wrong end of the buffer). o If the first received character(s) are part of a possible function key escape sequence, it will wait the timeout number of seconds for a next character. This eliminates the need to press escape twice. normal() Sends the escape sequence to turn off any highlightling (bold, reverse). bold() Sends the <B>mdB> value from termcap, which usually turns on bold. reverse() Sends the <B>mrB> value from termcap, which often turns on reverse text. underline() Turns on underline using the <B>usB> value from termcap. flash() Sends the visual bell escape sequence to the terminal. normal2esc() bold2esc() reverse2esc() underline2esc() flash2esc() Return the termcap definitions for normal, bold, reverse, underline and visual bell.
It was attested that on OpenSolaris 11, Term::Cap cannot provide the properties <B>normalB>, <B>boldB>, and <B>reverseB> because there is no termcap and infocmp -C does not provide these properties (even though infocmp does). In that case, fall back on terminfo.
raw() Sets raw input mode using stty(1). cooked() Sets cooked input mode using stty(1). flush_input() Duplicates the functionality of Term::Screen::flush_input(), but replaces getc() with sysread(). get_more_fn_keys() Adds more function key escape sequences.
Rene Uittenbogaard (email@example.com)
Term::ScreenColor was based on:
Term::Screen Originally by Mark Kaehny (firstname.lastname@example.org), now maintained by Jonathan Stowe (email@example.com). Term::ANSIColor By Russ Allbery (firstname.lastname@example.org) and Zenin (email@example.com).
Term::Screen(3pm), Term::Cap(3pm), termcap(5), stty(1)
|perl v5.20.3||SCREENCOLOR (3)||2010-10-04|