Struct extra::term::Terminal

pub struct Terminal {
    num_colors: u16,
    priv out: @std::io::Writer,
    priv ti: ~TermInfo,
}

Methods

impl Terminal

fn new(out: @std::io::Writer) -> std::result::Result

fn fg(&self, color: Color) -> bool

Sets the foreground color to the given color.

If the color is a bright color, but the terminal only supports 8 colors, the corresponding normal color will be used instead.

Returns true if the color was set, false otherwise.

fn bg(&self, color: Color) -> bool

Sets the background color to the given color.

If the color is a bright color, but the terminal only supports 8 colors, the corresponding normal color will be used instead.

Returns true if the color was set, false otherwise.

fn attr(&self, attr: Attr) -> bool

Sets the given terminal attribute, if supported. Returns true if the attribute was supported, false otherwise.

fn supports_attr(&self, attr: Attr) -> bool

Returns whether the given terminal attribute is supported.

fn reset(&self)

Resets all terminal attributes and color to the default.