LibTmux.Invoke-TmuxPaneCommand
LibTmux\Invoke-TmuxPaneCommand Run a shell command in a native pane and report its exit status.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/InvokeTmuxPaneCommandCommand.cs
- Invoke-TmuxPaneCommand [-Pane] <Lib
Tmux > [-Command] <System.Pane .String > [-Timeout <System.Double >] [-SuppressHistory <System.Boolean >] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
Run Command in a subshell in the selected pane and return a native
LibTmux.PaneRunResult. The result records the pane ID, authenticated shell exit status, whether the wait timed out, elapsed time and effective timeout. A nonzero exit status is a result, not a cmdlet error. The command does not change the parent shell's working directory or environment.A timeout returns
TimedOut = Trueand a nullExitStatus; the command may still be running. Cancellation after dispatch can leave it running too. Inspect the pane before retrying either case.Outputcontains bounded rendered command output, which may include stdout and stderr together. It is not a byte-exact process stream. InspectLinesMissed,AnchorLostand omission counts before treating it as complete.Started = Falsemeans no start marker was confirmed; it does not prove the command never ran. The default view omits output text. Get-TmuxPaneContent reads the current screen separately.The pane must be a live, writable POSIX-compatible shell.
-WhatIfperforms no tmux I/O or input operation. Confirmation identifies the endpoint and pane without displaying Command. A leading space is added to shell input by default; shells configured to ignore space-prefixed history entries may omit it from history. This is best effort.Notes
Tmux.PaneCommandFailedretains the pane as its target. The core reserves one active command per pane in this process. A timed-out run keeps its reservation until completion or an authenticated pane/server end; a second run is refused while that command may still be active. A borrowed server is never removed.Command details#
- Command type
cmdlet- Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.Pane: The native pane selected from an explicit endpoint. - Outputs
-
LibTmux.PaneRunResult
Examples#
Example 1 Given a native
$panerunning/bin/shon an endpoint you own, inspect a nonzero status without treating it as an operation failure: View sourceTerminal window $pane |LibTmux\Invoke-TmuxPaneCommand -Command 'exit 7' -Timeout 5 -Confirm:$falseThe result hasExitStatus = 7andTimedOut = False.- Parameters
-
-
The native pane from the endpoint you intend to change.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The shell command to run in a subshell. Empty, whitespace-only and NUL-containing commands are rejected. The core accepts at most 64 KiB of UTF-8 input.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNull()
-
The completion wait in seconds. Fractions are accepted. The default is 30; the valid range is 0.0000001 through 86400. NaN and infinity are rejected. Cleanup after an observed result may take additional time.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
30
-
-SuppressHistory(System.Boolean ) #Add a leading space to the shell input. Defaults to True. Set to False to omit the prefix; shell history behavior still depends on the shell and its configuration.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
True
-
-WhatIf(System.Management ) #.Automation .Switch Parameter Describe the intended command without sending it or acquiring fresh tmux state.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ) #.Automation .Switch Parameter Prompt before sending the command. The prompt does not show Command.
- 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.PaneRunResult:Oneresult per pane with exit status or a timeout indication.
Discussed in Check command completion · Getting started , Send input to a pane · Dispatch, completion, and failure