LibTmux.Invoke-TmuxChain
Execute an ordered command chain against one server.
Source and package
- Qualified name
-
LibTmux\ Invoke-Tmux Chain - Declared in
LibTmux- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/InvokeTmuxChainCommand.cs
- Invoke-TmuxChain [-Server] <Lib
Tmux > [-Command] <Lib.Server Tmux []> [-Max.Tmux Command Commands <System.Int32 >] [-MaxInput <SystemBytes .Int64 >] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
Execute an explicit array of native commands in order and return one merged
TmuxCommandResult. Native generation and window-placement guards are retained. An empty server pipeline performs no work. Admission validates the complete array before confirmation or dispatch.A failed command stops the remaining chain; earlier mutations remain. The result is merged stdout/stderr, not one receipt per command. Chains are not transactions. Cancellation cannot undo a command already sent to tmux.
Literal commands that an optional feature cannot run safely on the daemon's tmux release are refused before the requested commands are dispatched. Version checks may still contact tmux. A command that needs another release raises
LibTmux.TmuxVersionTooLowException. A session or window name that exactly tmux 3.7 rejects, and a layout string that tmux before 3.4 crashes on, raiseLibTmux.TmuxUnsupportedOnReleaseException, the type thatTmuxVersionTooLowExceptionderives from, so one catch of it covers every refusal. Only the command given is checked. A refused command carried inside another command's text is not: an if-shell or run-shell-Cstring, bind-key, set-hook, confirm-before, a menu, a prompt or choose template, or a brace block. Nested, it reaches tmux unchanged. A nameless break-pane ends a tmux 3.7 server, so on exactly 3.7 name every break-pane, including the one prefix ! runs, or upgrade to 3.7a. The other failures are listed at https://libtmux.org/en/powershell/latest/guides/compatibility/#what-the-checks-do-not-readNotes
Tmux.InvalidChainterminates invalid admission.Tmux.ChainFailedretains the native failure and server target.ErrorActionContinue permits later servers to run; Stop terminates.WhatIfdispatches nothing. Do not automatically retry an uncertain mutation.Command details#
- Command type
cmdlet- Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Server: The native server to execute against.- Outputs
LibTmux.TmuxCommandResult
Examples#
Example 1 Print two values in order on a previously selected
$server. View sourceTerminal window $commands = 'first', 'second' | ForEach-Object {LibTmux\New-TmuxCommand -Name 'display-message' -Arguments @('-p', $_)}$server | LibTmux\Invoke-TmuxChain -Command $commands- Parameters
-
-
The explicit endpoint that receives the operation.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Command(LibTmux []) #.Tmux Command A nonempty array of native commands in dispatch order.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
Positive admitted command count. Default: 1024.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1024- Validation
ValidateRange(1, 2147483647)
-
-MaxInputBytes(System.Int64 ) #Positive UTF-8 budget for command names and argument text, including one NUL terminator per item. Default: 1048576. This is an argv-text budget, not a process-memory or response budget. Native transport and operating-system limits still apply.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1048576- Validation
ValidateRange(1, 9223372036854776000)
-
-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.TmuxCommandResult:Onenative merged result after success.
Guides#
Pages that discuss Invoke-TmuxChain.
- Guides