Nullean.TerminalImages.TerminalGui
0.1.0
See the version list below for details.
dotnet add package Nullean.TerminalImages.TerminalGui --version 0.1.0
NuGet\Install-Package Nullean.TerminalImages.TerminalGui -Version 0.1.0
<PackageReference Include="Nullean.TerminalImages.TerminalGui" Version="0.1.0" />
<PackageVersion Include="Nullean.TerminalImages.TerminalGui" Version="0.1.0" />
<PackageReference Include="Nullean.TerminalImages.TerminalGui" />
paket add Nullean.TerminalImages.TerminalGui --version 0.1.0
#r "nuget: Nullean.TerminalImages.TerminalGui, 0.1.0"
#:package Nullean.TerminalImages.TerminalGui@0.1.0
#addin nuget:?package=Nullean.TerminalImages.TerminalGui&version=0.1.0
#tool nuget:?package=Nullean.TerminalImages.TerminalGui&version=0.1.0
Nullean.TerminalImages
Show images in the terminal with the Kitty, iTerm2 and Sixel protocols, with protocol detection and a half-block fallback. No dependencies, NativeAOT-safe.
var capabilities = await TerminalImageDetector.DetectAsync(); // what does this terminal speak?
var renderer = new TerminalImageRenderer(capabilities);
renderer.RenderPng(File.ReadAllBytes("photo.png"), Console.Out); // best protocol, scaled to fit
Site: https://terminal-images.nullean.net
Why
- Zero dependencies. The core package has no
PackageReferences: the PNG codec, resampler and all four encoders are managed code. No SkiaSharp, no ImageSharp, no native assets, so it publishes with NativeAOT (a 1.7 MBtcatbinary). - Detection that does not hang. It reads the environment first, then asks the terminal once with a batch of queries that always ends with a Device Attributes request, which every terminal answers. The wait ends when the terminal has said everything it will say.
- Hosts, not just a library. Integrations for Spectre.Console, Terminal.Gui v2 and XenoAtom.Terminal.
Packages
| Package | For |
|---|---|
Nullean.TerminalImages |
The core: image model, PNG codec, resampler, encoders, detection, renderer. No package dependencies. |
Nullean.TerminalImages.Spectre |
A TerminalImage renderable for Spectre.Console |
Nullean.TerminalImages.TerminalGui |
A TerminalImageView for Terminal.Gui v2, and detection that feeds Terminal.Gui's own pipeline |
Nullean.TerminalImages.XenoAtom |
WriteImage for XenoAtom.Terminal (no SkiaSharp) |
Documentation
- Getting started
- Detection: how the protocol is chosen
- The protocols and their trade-offs
- Spectre.Console, Terminal.Gui and XenoAtom
- Troubleshooting: tmux, SSH, Windows, support matrix
- DECISIONS.md: why it is built the way it is
Status
An early release. What has been verified, and how:
| Verified | How |
|---|---|
| Encoders, PNG codec, resampler, detection logic, renderer | Unit tests, with mutation checks: each rule was broken on purpose to confirm a test fails |
| Probing a terminal (raw mode, timeout, restoring the terminal) | The published NativeAOT binary run in a pseudo-terminal with a scripted terminal, on macOS and on Linux (in CI) |
| Terminal.Gui view | A live Terminal.Gui application with its ANSI driver, in tests |
| XenoAtom | Its in-memory backend |
| NativeAOT | Published with warnings as errors on macOS arm64, and in CI on Linux, macOS and Windows, where the published binary also runs |
Not yet verified: output on real terminals (Kitty, Ghostty, iTerm2, WezTerm, foot, Windows Terminal, xterm), and tmux or SSH. The terminal-specific choices in
TerminalBrands come from how other terminal image tools and the
terminals' documentation treat them. If a terminal misbehaves, tcat --diagnostics shows what was detected and why, and
NULLEAN_TERMINAL_IMAGES=kitty|iterm2|sixel|blocks|none overrides it.
Try it
dotnet run --project examples/Nullean.TerminalImages.Cat -- --diagnostics # what was detected, and why
dotnet run --project examples/Nullean.TerminalImages.Cat -- examples/sunset.png # draw an image
dotnet run --project examples/Nullean.TerminalImages.Cat -- --protocol sixel examples/sunset.png
tcat reads PNG files only: the library has a PNG decoder, and no JPEG or GIF decoder.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Nullean.TerminalImages (>= 0.1.0)
- Terminal.Gui (>= 2.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.