libperun

Class std.io.Console

Synopsis

public  class Console

Represents a console/terminal; this is used to set terminal colors and stuff like that.

Fields

Constructors

Methods

public static Console fromStream(OutputStream strm);

Create a Console instance from the specified stream, which must refer to a console.

Throws
std.rt.IllegalArgumentErrorIf strm is not a console.
public void setColor(ConsoleColor foreground,ConsoleColor background);

Set the console foreground and background to the specified colors.

The arguments can be remembered as referring to "X on Y", for example:

console.setColor(ConsoleColor.RED, ConsoleColor.BLACK); // "red on black"

public void setColor(ConsoleColor foreground);

Set the console color to the specified color, on a black background.

public void clear();

Clear the terminal, and move the cursor to beginning.