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.

PowerShell API

cmdlet libtmux-powershell latest

LibTmux.Invoke-TmuxCommand

Execute literal tmux arguments against an explicit server.

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

Description#

Pass the tmux command name and arguments as a string array. The adapter invokes the core directly without a shell. It returns a native TmuxCommandResult only on success; a nonzero exit writes an error retaining the result, target and dispatch metadata.

Literal commands that an optional feature cannot run safely on the daemon's tmux release are refused before the requested command is 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

Arguments can mutate tmux or run application commands. WhatIf performs no dispatch. Confirmation shows the command name without exposing the full argument content. Cancellation does not prove a dispatched mutation was rolled back; do not retry uncertain mutations automatically.

Command details#

Command type
cmdlet
Confirmation
Supports -WhatIf and -Confirm; confirm impact: Medium.
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: Native pipeline type for this command.
Outputs
LibTmux.TmuxCommandResult

Examples#

Example 1 Read the version of the existing server identified by $SocketPath. View source

Terminal window
$arguments = @('display-message', '-p', '#{version}')
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Invoke-TmuxCommand -Arguments $arguments
Parameters
Common parameters 12

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

Returns

LibTmux.TmuxCommandResult: Native pipeline type for this command.

Guides#

Pages that discuss Invoke-TmuxCommand.

Esc

Type to search.

Reference previewOpen reference