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
- Connect-TmuxControl [-Server] <Lib
Tmux > [-Target] <System.Server .String > [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
Attach one control client and return its native
IControlModeSession. The caller owns the returned client and must dispose it or useDisconnect-TmuxControlin 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.
WhatIfdoes not attach a client. An empty server pipeline performs no work.Notes
Tmux.ControlConnectFailedretains 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
-WhatIfand-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 withDisconnect-TmuxControl; the task guide shows a complete ownership scope. View sourceTerminal window $server | LibTmux\Connect-TmuxControl -Target 'fixture'- Parameters
-
-
The explicit endpoint that receives the operation.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
Nonempty raw tmux target to attach to. NUL and whitespace-only values are rejected.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()- Validation
ValidatePattern("\\A[^\\x00]*[^\\s\\x00][^\\x00]*\\z")
-
-WhatIf(System.Management ) #.Automation .Switch Parameter Show the operation without contacting tmux.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ) #.Automation .Switch Parameter Ask for confirmation before the operation.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
cf
Common parameters 12
PowerShell supplies these parameters. See common parameter behavior for their effects.
-
-Verbose(System.Management ) #.Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ) #.Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ) #.Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ) #.Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ) #.Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ) #.Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String ) #Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String ) #Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String ) #Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
-OutVariable(System.String ) #Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String ) #Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- 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