LibTmux.Invoke-TmuxCommand
Execute literal tmux arguments against an explicit server.
Source and package
- Qualified name
-
LibTmux\ Invoke-Tmux Command - Declared in
LibTmux- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/InvokeTmuxCommandCommand.cs
- Invoke-TmuxCommand [-Server] <Lib
Tmux > [-Arguments] <System.Server .String []> [-WhatIf ] [-Confirm] [<CommonParameters >] -
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
TmuxCommandResultonly 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, 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
Arguments can mutate tmux or run application commands.
WhatIfperforms 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
-WhatIfand-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 sourceTerminal window $arguments = @('display-message', '-p', '#{version}')LibTmux\New-TmuxServer -SocketPath $SocketPath |LibTmux\Invoke-TmuxCommand -Arguments $arguments- Parameters
-
-
The endpoint that receives the command.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Arguments(System.String []) #Literal arguments beginning with a tmux command name or alias. Global options such as
-S,-Land -f cannot replace the command name; configure the endpoint onServer. Invalid command names terminate before confirmation or dispatch.- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNull()- Validation
ValidateCount(1, 2147483647)
-
-WhatIf(System.Management ) #.Automation .Switch Parameter Runs the command in a mode that only reports what would happen without performing the actions.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ) #.Automation .Switch Parameter Prompts you for confirmation before running the cmdlet.
- 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: Native pipeline type for this command.
Guides#
Pages that discuss Invoke-TmuxCommand.