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

Execute an ordered command chain against one server.

Source and package
Qualified name
LibTmux\Invoke-TmuxChain
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/InvokeTmuxChainCommand.cs

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, raise LibTmux.TmuxUnsupportedOnReleaseException, the type that TmuxVersionTooLowException derives 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 -C string, 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-read

Notes

Tmux.InvalidChain terminates invalid admission. Tmux.ChainFailed retains the native failure and server target. ErrorAction Continue permits later servers to run; Stop terminates. WhatIf dispatches nothing. Do not automatically retry an uncertain mutation.

Command details

Command type
cmdlet
Confirmation
Supports -WhatIf and -Confirm; confirm impact: Medium.
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: The native server to execute against.
Outputs
LibTmux.TmuxCommandResult
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.TmuxCommandResult: One native merged result after success.

Examples

Example 1 Print two values in order on a previously selected $server. View source

Terminal window
$commands = 'first', 'second' | ForEach-Object {
LibTmux\New-TmuxCommand -Name 'display-message' -Arguments @('-p', $_)
}
$server | LibTmux\Invoke-TmuxChain -Command $commands

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\Invoke-TmuxChain.

Guides

task material

Pages that discuss Invoke-TmuxChain.

Esc
Search in

Type to search.

Reference previewOpen reference