LibTmux.Extensions.DependencyInjection
0.0.0-alpha.17
Prefix Reserved
dotnet add package LibTmux.Extensions.DependencyInjection --version 0.0.0-alpha.17
NuGet\Install-Package LibTmux.Extensions.DependencyInjection -Version 0.0.0-alpha.17
<PackageReference Include="LibTmux.Extensions.DependencyInjection" Version="0.0.0-alpha.17" />
<PackageVersion Include="LibTmux.Extensions.DependencyInjection" Version="0.0.0-alpha.17" />
<PackageReference Include="LibTmux.Extensions.DependencyInjection" />
paket add LibTmux.Extensions.DependencyInjection --version 0.0.0-alpha.17
#r "nuget: LibTmux.Extensions.DependencyInjection, 0.0.0-alpha.17"
#:package LibTmux.Extensions.DependencyInjection@0.0.0-alpha.17
#addin nuget:?package=LibTmux.Extensions.DependencyInjection&version=0.0.0-alpha.17&prerelease
#tool nuget:?package=LibTmux.Extensions.DependencyInjection&version=0.0.0-alpha.17&prerelease
LibTmux.Extensions.DependencyInjection
Registers LibTmux with
Microsoft.Extensions.DependencyInjection, so an application that already
composes its services can take a tmux server handle as a dependency.
Alpha. The public API is not settled and can change between prereleases without notice, so pin an exact version.
$ dotnet package add LibTmux.Extensions.DependencyInjection --prerelease
Registering
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddLibTmux(options => options with { SocketName = "build" });
Server is then injectable:
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using LibTmux;
public sealed class Builder(Server server)
{
public Task<IReadOnlyList<Session>> SessionsAsync(CancellationToken cancellationToken) =>
server.GetSessionsAsync(cancellationToken);
}
What it registers, and why that lifetime
Server is a singleton. Handles are immutable and safe to share across
threads, and AddLibTmux opens rather than connects: nothing runs tmux until
something asks it to, and a tmux that restarts is picked up by the next call
rather than turning the handle stale. Nothing serializes tmux itself — one
server applies commands in the order it receives them.
Options
ServerConnectionOptions is registered through IOptions<T>, so it binds from
configuration. This example also references Microsoft.Extensions.Configuration
and Microsoft.Extensions.Options.ConfigurationExtensions:
using LibTmux;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
var configuration = new Microsoft.Extensions.Configuration.ConfigurationBuilder().Build();
configuration["LibTmux:SocketName"] = "build";
services.Configure<ServerConnectionOptions>(configuration.GetSection("LibTmux"));
services.AddLibTmux();
The options are immutable, so the callback answers a copy rather than mutating one. It runs after binding, which makes it the last word:
using System;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddLibTmux(options => options with { CommandTimeout = TimeSpan.FromSeconds(5) });
When the options name no logger and the provider has an ILoggerFactory, one
is taken from it, so tmux commands are logged with everything else.
License
| Product | Versions 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. |
-
net10.0
- LibTmux (>= 0.0.0-alpha.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
-
net8.0
- LibTmux (>= 0.0.0-alpha.17)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
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.0.0-alpha.17 | 31 | 9/27/2026 |
| 0.0.0-alpha.16 | 33 | 9/26/2026 |
| 0.0.0-alpha.15 | 58 | 9/20/2026 |
| 0.0.0-alpha.14 | 52 | 9/20/2026 |
Alpha. LibTmux, LibTmux.FSharp, LibTmux.Testing, LibTmux.Query.Json, LibTmux.Extensions.DependencyInjection, LibTmux.Workspace, LibTmux.Workspace.Cli and LibTmux.Mcp share one version, so this release covers them together. What changed, per package and per release: https://github.com/libtmux/libtmux-dotnet/blob/master/CHANGELOG.md The public API is not settled and may change without notice between prereleases; pin an exact version.