kameloso.terminal

Helpers to set up a terminal environment.

Modules

colours
module kameloso.terminal.colours

A collection of functions that relate to applying ANSI effects to text.

Members

Enums

TerminalToken
enum TerminalToken

Special terminal control characters.

Functions

applyTerminalOverrides
void applyTerminalOverrides(bool flush, bool colours)

Potentially sets CoreSettings.flush and/or CoreSettings.colours if the terminal seems to not truly be a terminal (such as a pager, or a non-whitelisted IDE terminal emulator).

ensureAppropriateBuffering
void ensureAppropriateBuffering()

Ensures select non-TTY environments (like Cygwin) are line-buffered.

isTTY
bool isTTY()

Determines whether or not the program is being run in a terminal (virtual TTY).

isTerminal
bool isTerminal()

Determines whether or not the program is being run in a terminal, be it a real TTY or a whitelisted pseudo-TTY such as those employed in IDE terminal emulators.

resetConsoleModeAndCodepage
void resetConsoleModeAndCodepage()

Resets the console codepage and console mode to the values they had at program start.

resetTerminalTitle
void resetTerminalTitle()

Resets the terminal title to an empty string.

setConsoleModeAndCodepage
void setConsoleModeAndCodepage()

Sets the console codepage to display UTF-8 characters (åäö, 高所恐怖症, ...) and the console mode to display terminal colours.

setTerminalTitle
void setTerminalTitle(string title)

Sets the terminal title to a given string. Supposedly.

Static variables

originalCP
uint originalCP;

Original codepage at program start.

originalConsoleMode
uint originalConsoleMode;

Original console mode at program start.

originalOutputCP
uint originalOutputCP;

Original output codepage at program start.

See Also

Meta