LibTmux.Testing 0.1.2

Prefix Reserved
dotnet add package LibTmux.Testing --version 0.1.2
                    
NuGet\Install-Package LibTmux.Testing -Version 0.1.2
                    
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="LibTmux.Testing" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LibTmux.Testing" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="LibTmux.Testing" />
                    
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 LibTmux.Testing --version 0.1.2
                    
#r "nuget: LibTmux.Testing, 0.1.2"
                    
#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 LibTmux.Testing@0.1.2
                    
#: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=LibTmux.Testing&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=LibTmux.Testing&version=0.1.2
                    
Install as a Cake Tool

LibTmux.Testing

LibTmux.Testing libtmux.org

Scoped tmux servers, sessions and windows for testing code that drives tmux, on top of LibTmux.

Each scope owns what it created. Disposal attempts to tear it down even when the test body throws.

Add it to your test project:

$ dotnet add package LibTmux.Testing

Quick start

Give a test a tmux server of its own, type into its pane, and wait for the result. The block uses ct from your test:

using LibTmux;
using LibTmux.Testing;

TmuxTestFactory factory = new();
await using TemporaryHierarchyScope scope = await factory.CreateHierarchyAsync(cancellationToken: ct);

await scope.Pane.SendTextAsync("echo $((6 * 7))", cancellationToken: ct);
await scope.Pane.EnterAsync(ct);

// The product is printed only once the shell has run the line.
string screen = await TmuxWait.UntilAsync(
    async token => string.Join('\n', await scope.Pane.CaptureAsync(cancellationToken: token)),
    text => text.Contains("42", StringComparison.Ordinal),
    TimeSpan.FromSeconds(10),
    TimeSpan.FromMilliseconds(20));

It prints nothing and returns once the pane shows 42. Disposing the scope kills the server, even when an assertion above it throws.

Create the scopes a test needs

TmuxTestFactory: a server, session, window, or whole hierarchy

CreateHierarchyAsync starts a server on a socket of its own, with one session, window, and pane.

The TemporaryServerScope, TemporarySessionScope, and TemporaryWindowScope types stop at the level their name gives. TmuxNameGenerator hands out names no live session is using.

TmuxWait.UntilAsync: wait for a state

It polls a state until a condition holds or a timeout passes, and it replaces a sleep. It ships in LibTmux, because reading back what a command produced is client work.

What it leaves out

  • Test scaffolding in your application. This ships apart from LibTmux, so an application that references the client carries no test scaffolding in its output or its trim closure.
  • Your existing tmux. Default settings create a server on a unique socket. Disposal stops only the daemon the scope owns.

Support and status

  • Pre-1.0. Any release may change or remove an exported identifier. The changelog marks each break, so pin an exact version.
  • Dependencies. LibTmux.
  • tmux and .NET. The tmux versions LibTmux supports, on net8.0 and net10.0.
  • Systems. Linux, including WSL. macOS is best effort.

Documentation

License

MIT

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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 109 11/29/2026
0.1.1 124 11/1/2026
0.1.0 133 10/25/2026
0.0.0-alpha.24 82 10/25/2026
0.0.0-alpha.23 84 10/24/2026
0.0.0-alpha.22 80 10/19/2026
0.0.0-alpha.21 78 10/11/2026
0.0.0-alpha.20 83 10/5/2026
0.0.0-alpha.19 90 10/4/2026
0.0.0-alpha.18 81 10/3/2026
0.0.0-alpha.17 88 9/27/2026
0.0.0-alpha.16 83 9/26/2026
0.0.0-alpha.15 97 9/20/2026
0.0.0-alpha.14 89 9/20/2026

All eight LibTmux packages share version 0.1.2. LibTmux guards raw layout commands on older tmux servers, and LibTmux.Mcp ships the MCP SDK 2.4.0. Pin exact package versions while the public API is evolving. Read the LibTmux.Testing changelog at https://github.com/libtmux/libtmux-dotnet/blob/master/src/LibTmux.Testing/CHANGELOG.md and the release summary at https://github.com/libtmux/libtmux-dotnet/blob/v0.1.2/CHANGELOG.md