# dmd.console

Control the various text mode attributes, such as color, when writing text to the `console`.

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: console.d

Documentation: https://dlang.org/phobos/dmd_console.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/console.d

- `detectTerminal`

  #### Declaration

  `nothrow bool `detectTerminal`();`

  Tries to detect whether DMD has been invoked from a terminal.

  #### Return Value

  `true` if a terminal has been detected, `false` otherwise

- `detectColorPreference`

  #### Declaration

  `nothrow @trusted bool `detectColorPreference`();`

  Tries to detect the preference for colorized console output based on the `NO_COLOR` environment variable: https://no-color.org/

  #### Return Value

  `true` if colorized console output is preferred

- `createConsole`

  #### Declaration

  `nothrow Console `createConsole`(FILE* `fp`);`

  Creates an instance of Console connected to stream `fp`.

  #### Parameters

  `FILE* `fp`` | io stream

  #### Return Value

  reference to created Console