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.

MoreLess about this notice

cmdlet libtmux-powershell

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

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'

Recorded calls

source calls
No call edges in the PowerShell model.

The PowerShell reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux\Connect-TmuxControl.

tmux command

task material

The tmux commands behind Connect-TmuxControl.

tmux C API

task material

The C declarations in tmux that implement these commands.

Guides

task material

Pages that discuss Connect-TmuxControl.

Esc
Search in

Type to search.

Reference previewOpen reference