docfx/apispec/namespace-drivers.md
The Drivers namespace provides the platform abstraction layer enabling Terminal.Gui to run consistently across Windows, macOS, and Linux/Unix.
| Driver | Platform | Description |
|---|---|---|
windows | Windows | Native Win32 Console API with highest performance |
unix | Unix/Linux/macOS | Direct syscalls with ANSI sequences |
dotnet | All | Cross-platform using System.Console |
ansi | All | Pure ANSI implementation, ideal for testing |
// Automatic (recommended)
app.Init (); // Selects best driver for platform
// Explicit selection
app.Init (DriverRegistry.Names.ANSI);
// Via configuration
app.ForceDriver = DriverRegistry.Names.UNIX;
app.Init ();
Drivers expose raster protocol detection through IDriver.KittyGraphicsSupport and IDriver.SixelSupport, plus matching change events. Kitty graphics is the preferred raster protocol when supported. Sixel remains the fallback for terminals that do not support Kitty graphics. IOutput.UseKittyGraphics selects the Kitty output path; when it is false and Sixel is supported, raster commands are emitted as Sixel.
The driver architecture uses a multi-threaded design:
This separation ensures responsive input handling even during intensive UI operations.
See the Cross-Platform Driver Model for comprehensive details.