Core LibraryAPI Reference

Choose documentation 2

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

cmdlet libtmux-powershell latest

LibTmux.Connect-TmuxControl

LibTmux\Connect-TmuxControl LibTmux\Connect-TmuxControl

Attach a native control client to an explicit tmux target.

Source and package
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

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.

Discussed in Getting started , Watch events and use runspaces · Ownership and cleanup

Esc

Type to search.

Reference preview Open reference