Skip to content
Documentation

IConsole Interface

Abstracts the system console for HAKOM applications, extending System.CommandLine.IConsole with encoding and window-dimension members.

public interface IConsole : System.CommandLine.IConsole, System.CommandLine.IO.IStandardOut, System.CommandLine.IO.IStandardError, System.CommandLine.IO.IStandardIn

Implements System.CommandLine.IConsole, System.CommandLine.IO.IStandardOut, System.CommandLine.IO.IStandardError, System.CommandLine.IO.IStandardIn

Inject IConsole into commands and services instead of referencing System.Console directly so that output and input can be redirected or captured in unit tests.

The production implementation is registered by UseConsole(this IContainer). A test-friendly singleton that wraps explicit System.IO.TextWriter and System.IO.TextReader instances is registered by the three-argument overload.

Gets the System.IO.TextWriter used for standard error output.

System.IO.TextWriter Error { get; }

Implements Error

System.IO.TextWriter

Gets the System.IO.TextReader used for standard input.

System.IO.TextReader In { get; }

System.IO.TextReader

Gets the character encoding used when reading from In.

System.Text.Encoding InputEncoding { get; }

System.Text.Encoding

Gets the System.IO.TextWriter used for standard output.

System.IO.TextWriter Out { get; }

Implements Out

System.IO.TextWriter

Gets the character encoding used when writing to Out.

System.Text.Encoding OutputEncoding { get; }

System.Text.Encoding

Gets the height of the console window, in character rows.

int WindowHeight { get; }

System.Int32

Gets the width of the console window, in characters.

int WindowWidth { get; }

System.Int32

© 2026 Volue.Version v0.6.38017 November 2026