Fixes #5489. Add Kitty graphics protocol support (Kitty, Ghostty) with Kitty-first priority#5493
Conversation
- Add KittyGraphicsSupportResult, KittyGraphicsSupportDetector, KittyGraphicsEncoder in Terminal.Gui/Drawing/Kitty/ (same namespace as Sixel types) - Extend IDriver/DriverImpl with KittyGraphicsSupport property and event - Detect Kitty terminal at startup in MainLoopCoordinator (KITTY_WINDOW_ID / TERM_PROGRAM=kitty|ghostty env vars; no ANSI queuing required) - Add EncodedKitty to RasterImageCommand; OutputBase dispatches to Kitty APC or Sixel DCS based on UseKittyGraphics flag - Add protocol-agnostic UseRasterGraphics / IsUsingRasterGraphics on ImageView; mark UseSixel and IsUsingSixel [Obsolete] with functional redirects - Rename DrawSixel → DrawRasterImage (handles both protocols) - When both Kitty and Sixel are available, Sixel is preferred for backward compatibility with existing deployments (e.g. Windows Terminal) - Add 17 unit tests: KittyGraphicsEncoderTests, KittyGraphicsSupportDetectorTests, KittyGraphicsSupportResultTests, plus 3 OutputBase Kitty tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 650534949c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…orted; align GetActiveResolution with CreateRenderRequest
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@copilot remember, WinPrint is still in dev. The whole reason I'm adding kitty is because of Mac support. Unless i misunderstand, kitty is simply better. |
This comment was marked as outdated.
This comment was marked as outdated.
|
@copilot yes and file an issue for WinPrint to refactor based on this pr |
…ck for non-Kitty terminals
This comment was marked as outdated.
This comment was marked as outdated.
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
Replace the static frame with an animated capture: resize the image view so its top-left corner fills the top-left of the display, then keyboard-zoom into the left antenna (mini-Mandelbrot satellite), pan around at depth, and zoom back out. Recorded via tuirec with the Sixel raster protocol forced (Auto prefers Kitty, which agg cannot render). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Depends which part the question addresses, lol The image display speed is interesting; your Mandelbrot scenario renders quite fast with both sixel and kitty, but loading then resizing even a small image in the Images scenario is very slow and spikes my CPU when using sixel, but buttery-smooth using kitty. |
Kitty is just a better protocol. Hopefully WT will support it eventually. In the meantime, the scenario I care about is displaying rendered graphics like Mandelbrot and it works amazingly well with either which kinda shocking to me. |


Fixes
Adds Kitty graphics protocol support as a Kitty-first raster backend for
ImageView, with Sixel retained as the fallback and cell rendering unchanged when no raster protocol is available.Also updates the raster graphics surface area and demos:
UseSixel/IsUsingSixelas obsolete compatibility shims overUseRasterGraphics.+,=,-,0; PageUp/PageDown still work).MandelbrotImageView, where zoom/pan/reset re-render fractal coordinates instead of scaling a static bitmap.Validation covers Kitty encoder/detector/output behavior, Kitty-vs-Sixel priority and resolution selection, ImageView zoom bindings, Images scenario nullability contracts, and the standard build/test suites.