Table of Contents

Class KittyGraphicsSupportDetector

Namespace
Terminal.Gui.Drawing
Assembly
Terminal.Gui.dll

Detects whether the active terminal supports the Kitty graphics protocol by inspecting well-known environment variables set by Kitty-compatible terminals.

public class KittyGraphicsSupportDetector
Inheritance
KittyGraphicsSupportDetector
Inherited Members

Remarks

Detection checks the following environment variables in order:

<ol><li><code>KITTY_WINDOW_ID</code> — set by the Kitty terminal emulator.</li><li><code>TERM_PROGRAM</code> equal to <code>kitty</code> or <code>ghostty</code>.</li></ol>

When support is confirmed, the detector attempts to derive the pixel-per-cell Resolution via ANSI window-size queries (the same fallback used by SixelSupportDetector).

Constructors

KittyGraphicsSupportDetector()

Creates a new instance of the KittyGraphicsSupportDetector class.

KittyGraphicsSupportDetector(IDriver)

Creates a new instance of the KittyGraphicsSupportDetector class bound to the specified driver (used for resolution queries).

Methods

Detect(Action<KittyGraphicsSupportResult>)

Detects Kitty graphics protocol support and invokes resultCallback with the result. When support is detected the detector also attempts to resolve Resolution via ANSI queries; if those are unavailable the default 10×20 resolution is used.