Core LibraryAPI Reference

Choose documentation 2

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

cmdlet libtmux-powershell latest

LibTmux.Invoke-TmuxControlCommand

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

Description#

Send one native command and emit its reply lines as strings. Commands with 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. WhatIf sends nothing; an empty connection pipeline performs no work.

Notes

Tmux.InvalidCommand rejects a global option in the command-name position before dispatch. Tmux.ControlCommandFailed retains native exceptions and the connection target. ErrorAction Continue 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 from IControlModeSession .

Command details#

Command type
cmdlet
Confirmation
Supports -WhatIf and -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 $control owned by your surrounding try/finally scope. View source

Terminal window
$command = LibTmux\New-TmuxCommand -Name 'display-message' -Arguments @(
'-p', '#{session_name}'
)
$control | LibTmux\Invoke-TmuxControlCommand -Command $command
Parameters
Common parameters 12

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

Returns

System.String : Native reply lines, in reply order.

Discussed in Commands and control clients , Getting started · Dispatch, completion, and failure

Esc

Type to search.

Reference preview Open reference