LibTmux.Invoke-TmuxControlCommand
LibTmux\Invoke-TmuxControlCommand Run a native command on a borrowed control client.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/InvokeTmuxControlCommandCommand.cs
- Invoke-TmuxControlCommand [-Connection] <Lib
Tmux > [-Command] <Lib.IControl Mode Session Tmux > [-What.Tmux Command If ] [-Confirm] [<CommonParameters >] -
Description#
Send one native command and emit its reply lines as strings.
Commandswith no reply emit no success object. Native commands retain their generation and placement guards; raw commands use tmux target resolution.Concurrent callers receive their correlated replies from the core. Cancelling stops this caller waiting, not a command already sent, and does not dispose the borrowed client. A later send remains usable after the cancelled command finishes.
WhatIfsends nothing; an empty connection pipeline performs no work.Notes
Tmux.InvalidCommandrejects a global option in the command-name position before dispatch.Tmux.ControlCommandFailedretains native exceptions and the connection target.ErrorActionContinue permits later clients to run. The core bounds pending requests and replies; rejected admission does not retry. Confirmation identifies the supplied connection without inventing endpoint metadata absent fromIControlModeSession.Command details#
- Command type
cmdlet- Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.IControlModeSession: The borrowed client to send through. - Outputs
-
System.String
Examples#
Example 1 Print the attached session name using an existing
$controlowned by your surrounding try/finally scope. View sourceTerminal window $command = LibTmux\New-TmuxCommand -Name 'display-message' -Arguments @('-p', '#{session_name}')$control | LibTmux\Invoke-TmuxControlCommand -Command $command- Parameters
-
-
-Connection(LibTmux ) #.IControl Mode Session The native control client. This operation borrows the supplied client.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Command(LibTmux ) #.Tmux Command The native command. Raw commands contain no captured entity identity guard.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNull()
-
-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
-
System.String: Native reply lines, in reply order.
Discussed in Commands and control clients , Getting started · Dispatch, completion, and failure