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

applyMonochromeAndFlushOverrides
void applyMonochromeAndFlushOverrides(bool monochrome, bool flush)

Override CoreSettings.monochrome and potentially CoreSettings.flush 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.

setConsoleModeAndCodepage
void setConsoleModeAndCodepage()

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

setTitle
void setTitle(string title)

Sets the terminal title to a given string. Supposedly.

Imports

SetConsoleCP (from core.sys.windows.wincon)
public import core.sys.windows.wincon : SetConsoleCP, SetConsoleMode, SetConsoleOutputCP;
Undocumented in source.
SetConsoleMode (from core.sys.windows.wincon)
public import core.sys.windows.wincon : SetConsoleCP, SetConsoleMode, SetConsoleOutputCP;
Undocumented in source.
SetConsoleOutputCP (from core.sys.windows.wincon)
public import core.sys.windows.wincon : SetConsoleCP, SetConsoleMode, SetConsoleOutputCP;
Undocumented in source.

See Also

Meta