Core Library0.xAPI Reference

Choose documentation 2

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

cmdlet libtmux-powershell latest

LibTmux.Connect-TmuxControl

Attach a native control client to an explicit tmux target.

Source and package
Qualified name
LibTmux\Connect-TmuxControl
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/ConnectTmuxControlCommand.cs

Description#

Attach one control client and return its native IControlModeSession. The caller owns the returned client and must dispose it or use Disconnect-TmuxControl in finally. The server and its sessions are borrowed.

Target is raw tmux target syntax, resolved when connecting. A name, index or ID does not carry a captured entity identity guard. No implicit current session is selected. WhatIf does not attach a client. An empty server pipeline performs no work.

Notes

Control clients need tmux 3.7 or newer. On a daemon older than tmux 3.7 this cmdlet reports LibTmux.TmuxVersionTooLowException as its error and attaches no control client.

Tmux.ControlConnectFailed retains the original failure and server target. If pipeline output fails before the client transfers to the caller, the cmdlet disposes it. Stop cancels attachment; it never kills the borrowed tmux server.

Command details#

Command type
cmdlet
Confirmation
Supports -WhatIf and -Confirm; confirm impact: Medium.
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: The native endpoint to attach to.
Outputs
LibTmux.IControlModeSession

Examples#

Example 1 Attach to fixture on a previously selected $server. Retain the returned client and close it in finally with Disconnect-TmuxControl; the task guide shows a complete ownership scope. View source

Terminal window
$server | LibTmux\Connect-TmuxControl -Target 'fixture'
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.IControlModeSession: The newly attached client. Its ownership transfers to the caller.

tmux command#

The tmux commands behind Connect-TmuxControl.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss Connect-TmuxControl.

Esc

Type to search.

Reference previewOpen reference