Icod.Terminal 0.13.0

dotnet add package Icod.Terminal --version 0.13.0
                    
NuGet\Install-Package Icod.Terminal -Version 0.13.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Icod.Terminal" Version="0.13.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Icod.Terminal" Version="0.13.0" />
                    
Directory.Packages.props
<PackageReference Include="Icod.Terminal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Icod.Terminal --version 0.13.0
                    
#r "nuget: Icod.Terminal, 0.13.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Icod.Terminal@0.13.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Icod.Terminal&version=0.13.0
                    
Install as a Cake Addin
#tool nuget:?package=Icod.Terminal&version=0.13.0
                    
Install as a Cake Tool

Icod.Terminal

Icod TUI Toolchain

Icod.Terminal is the managed, cross-platform live-terminal layer for the Icod library family. It sits between Icod.TermInfo and higher-level consumers such as Icod.DCurses, terminal-aware command-line tools, monitors, editors, pagers, and REPLs.

Status

0.13.0 is the current stable release. It adds typed, observable terminal-color control for the indexed palette and the useful non-Tektronix xterm dynamic-color family.

The release covers:

  • OSC 4 indexed palette mutation/query;
  • OSC 104 indexed palette reset;
  • OSC 10 / 110 default foreground;
  • OSC 11 / 111 default background;
  • OSC 12 / 112 text cursor;
  • OSC 13 / 113 mouse foreground;
  • OSC 14 / 114 mouse background;
  • OSC 17 / 117 highlight background;
  • OSC 19 / 119 highlight foreground.

OSC 15/16/18 and resets 115/116/118 remain deliberately excluded as Tektronix-specific dynamic colors.

Installation

dotnet add package Icod.Terminal --version 0.13.0

The package targets net8.0, net9.0, and net10.0 and depends on Icod.TermInfo 1.10.0 and Icod.Timing 1.0.0.

Architecture

Icod.TermInfo
      ^
      |
Icod.Terminal
      ^
      |
Icod.DCurses
      ^
      |
watch / slabtop / top

Icod.TermInfo remains the immutable terminal-capability authority. Icod.Terminal owns live endpoint observation, terminal modes, input, dimensions, lifecycle, terminal identity, output setup, active terminal-query routing, and semantic terminal-output operations. Icod.DCurses owns cells, windows, virtual-screen state, and refresh/diff policy.

Quick start — observable terminal colors

using Icod.Terminal;

await using TerminalSession session = await TerminalSession.OpenAsync(
	new TerminalSessionOptions {
		InputMode = TerminalInputMode.CBreak,
		EchoInput = false
	}
);

TimeSpan timeout = TimeSpan.FromMilliseconds( 750 );

TerminalColor paletteRed = await session.QueryPaletteColorAsync(
	1,
	timeout
);

TerminalColor foreground = await session.QueryDynamicColorAsync(
	TerminalDynamicColor.DefaultForeground,
	timeout
);

TerminalColor preserves normalized 16-bit RGB channels:

TerminalColor color = new(
	0x1234,
	0x5678,
	0x9abc
);

TerminalColor fromBytes = TerminalColor.FromRgb8(
	0x12,
	0x34,
	0x56
);

FromRgb8(...) expands bytes by multiplication by 257, so 0x12 becomes 0x1212.

Indexed palette — OSC 4 / 104

Single mutation:

await session.SetPaletteColorAsync(
	1,
	TerminalColor.FromRgb8( 255, 64, 64 )
);

Bounded multi-entry mutation:

await session.SetPaletteColorsAsync(
	[
		new TerminalPaletteColor( 1, TerminalColor.FromRgb8( 255, 0, 0 ) ),
		new TerminalPaletteColor( 2, TerminalColor.FromRgb8( 0, 255, 0 ) )
	]
);

Observation:

TerminalColor color = await session.QueryPaletteColorAsync(
	1,
	TimeSpan.FromMilliseconds( 750 )
);

Terminal-policy reset:

await session.ResetPaletteColorAsync( 1 );
await session.ResetPaletteColorsAsync( [ 1, 2, 3 ] );
await session.ResetPaletteAsync();

Bulk OSC 4 mutation is bounded to 256 distinct entries, rejects duplicates and empty collections, validates before commitment, and emits one complete frame.

Dynamic colors — OSC 10–14, 17, 19

The semantic identities are:

TerminalDynamicColor.DefaultForeground
TerminalDynamicColor.DefaultBackground
TerminalDynamicColor.TextCursor
TerminalDynamicColor.MouseForeground
TerminalDynamicColor.MouseBackground
TerminalDynamicColor.HighlightBackground
TerminalDynamicColor.HighlightForeground

Set, observe, and reset all use one semantic API family:

await session.SetDynamicColorAsync(
	TerminalDynamicColor.TextCursor,
	TerminalColor.FromRgb8( 64, 255, 64 )
);

TerminalColor cursor = await session.QueryDynamicColorAsync(
	TerminalDynamicColor.TextCursor,
	TimeSpan.FromMilliseconds( 750 )
);

await session.ResetDynamicColorAsync(
	TerminalDynamicColor.TextCursor
);

The common/core interoperability tier is OSC 10/11/12. OSC 13/14/17/19 are documented as the extended xterm tier and may have lower support across terminal implementations.

Color encoding and observation

Canonical outbound colors use exactly:

rgb:rrrr/gggg/bbbb

with four lowercase hexadecimal digits per channel and ST (ESC \\) OSC termination.

Inbound color observations accept strict equal-width 1–4 digit rgb: components plus #RGB, #RRGGBB, #RRRGGGBBB, and #RRRRGGGGBBBB.

The two shorthand grammars intentionally normalize differently:

  • rgb: components scale to the complete 16-bit range;
  • hash components supply the most-significant bits and zero-fill the remaining low bits.

Named colors, rgbi:, CSS color syntax, alpha forms, mixed-width rgb: components, surrounding whitespace, and trailing junk are rejected.

Query semantics

Color observation uses the existing session-owned active-query transaction/router.

  • opening a session performs no automatic color probing;
  • no second response reader is introduced;
  • each query has an explicit finite timeout;
  • caller cancellation remains distinct from timeout;
  • correlated malformed color replies fail with FormatException;
  • successful observations are not cached as authoritative terminal state;
  • a timeout is not converted into a permanent “unsupported” capability result.

Reset is not restoration

OSC 104 and OSC 110–119 request the terminal's configured/default policy. They are not exact restoration of a color previously observed by this library.

0.13 therefore deliberately exposes no palette-color or dynamic-color lease. Color mutation is unscoped: InvalidateState(), managed suspend/resume, and DisposeAsync() do not automatically query, reset, or replay color values.

A future lifecycle-safe color lease would need a truthful baseline and post-resume re-observation before reapplying owned state. 0.13 does not alter the core lifecycle/query ordering merely to simulate that guarantee.

Downstream Icod.DCurses observation

The T137 downstream acceptance proves that Icod.DCurses 0.1.0 can consume typed 16-bit TerminalColor observations without parsing raw OSC or opening another input path.

Current Icod.DCurses uses 8-bit CursesColor.Rgb, so the acceptance performs an explicit downstream precision adaptation and then renders observed colors through setrgbf / setrgbb capabilities. Icod.Terminal itself does not discard the observed 16-bit precision.

Color-distance metrics, nearest-palette selection, contrast/accessibility policy, and theme inference remain higher-level responsibilities.

The stable public contract is recorded in docs/Public-API-Baseline-0.13.md. Composition/downstream acceptance is recorded in docs/T137-Color-Composition-and-DCurses-Observation-Acceptance.md.

Previous release highlights

Samples

Focused samples include:

See samples/README.md for run instructions.

Build and validation

On Windows:

build.cmd

On POSIX hosts:

sh build.sh

Distribution validation builds/tests the solution, runs real downstream Icod.DCurses synchronized-output, progress, pointer-shape, semantic-prompt, and color-observation acceptance, packs the NuGet artifact, verifies package structure/XML documentation, and runs fresh package-only consumers.

The 0.8 through 0.13 package contracts restore and run from the freshly produced NuGet artifact on net8.0, net9.0, and net10.0.

Release process

Publishing 0.13.0 requires:

  1. exact stable PR-head validation green on Windows, Linux, and macOS;
  2. exact Staging package verification green;
  3. all five real downstream Icod.DCurses acceptance gates green;
  4. retained 0.8–0.12 plus new 0.13 XML/package-only smoke gates green on all supported TFMs;
  5. merge to main;
  6. Release distribution validation green on the resulting exact main commit;
  7. only then create tag v0.13.0.

The tagged workflow reruns build/tests, downstream acceptance, exact package selection, historical package contracts, and the 0.13 color package contract before publication to NuGet.org and GitHub Packages.

Development roadmap

The 0.13 milestone is documented in Icod.Terminal-0.13.0-Development-Roadmap.md, with tranche records T130–T138 under docs/.

License

Icod.Terminal is licensed under LGPL-3.0-or-later. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Icod.Terminal:

Package Downloads
Icod.DCurses

Managed, cross-platform curses-like terminal UI library for .NET, built on Icod.TermInfo and Icod.Terminal.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.13.0 0 9/6/2026
0.12.0 32 9/5/2026
0.11.0 38 9/5/2026
0.10.0 41 9/5/2026
0.9.0 38 9/5/2026
0.8.0 50 9/5/2026
0.7.0 39 9/5/2026
0.6.1 37 9/4/2026
0.6.0 34 9/4/2026
0.5.0 37 9/4/2026
0.4.0 39 9/4/2026
0.3.0 3,094 8/29/2026
0.3.0-alpha.8 67 8/28/2026
0.2.0 87 8/28/2026
0.2.0-alpha.6 87 8/27/2026
0.1.0 85 8/27/2026
0.1.0-alpha.13 56 8/27/2026
0.1.0-alpha.11 1,755 8/25/2026
0.1.0-alpha.10 70 8/25/2026
0.1.0-alpha.9 58 8/25/2026

0.13.0 adds observable terminal color control: 16-bit TerminalColor values; OSC 4 indexed-palette mutation/query and OSC 104 reset; semantic OSC 10-14/17/19 dynamic-color mutation/query with resets 110-114/117/119; strict color response parsing; explicit unscoped lifecycle semantics; and downstream Icod.DCurses typed color-observation acceptance.