LibTmux.Set-TmuxOption
LibTmux\Set-TmuxOption Set an option in a native tmux owner table.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/SetTmuxOptionCommand.cs
- Pane: Set-TmuxOption [-Pane] <Lib
Tmux > -Name <System.Pane .String > [-Scope <System.Nullable [LibTmux ]>] [-Global] -Value <System.Option Scope .String > [-Append] [-ExpandFormat ] [-PreventOverwrite ] [-PassThru ] [-Quiet] [-WhatIf ] [-Confirm] [<CommonParameters >] Server (default): Set-TmuxOption [-Server] <LibTmux > -Name <System.Server .String > [-Scope <System.Nullable [LibTmux ]>] [-Global] -Value <System.Option Scope .String > [-Append] [-ExpandFormat ] [-PreventOverwrite ] [-PassThru ] [-Quiet] [-WhatIf ] [-Confirm] [<CommonParameters >] Session: Set-TmuxOption [-Session] <LibTmux > -Name <System.Session .String > [-Scope <System.Nullable [LibTmux ]>] [-Global] -Value <System.Option Scope .String > [-Append] [-ExpandFormat ] [-PreventOverwrite ] [-PassThru ] [-Quiet] [-WhatIf ] [-Confirm] [<CommonParameters >] Window: Set-TmuxOption [-Window] <LibTmux > -Name <System.Window .String > [-Scope <System.Nullable [LibTmux ]>] [-Global] -Value <System.Option Scope .String > [-Append] [-ExpandFormat ] [-PreventOverwrite ] [-PassThru ] [-Quiet] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
Store one option or indexed array entry. Append, format expansion and overwrite protection are delegated to tmux. PassThru returns its native
TmuxOptionValuereadback, so an appended or expanded value is the value stored, not an echo of the argument. An empty string remains a value.WhatIfperforms no tmux I/O.Notes
Reads contact tmux explicitly. Empty owner pipelines perform no I/O. Errors retain the original core exception and native owner as their target.
ErrorActionContinue permits later owners; Stop terminates the pipeline. Cancellation stops the operation but cannot undo a dispatched mutation. Set readback is an observation, not a transaction with other clients.Command details#
- Command type
cmdlet- Default parameter set
-
Server - Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.Server: A native server owner.;LibTmux.Session: A native session owner.;LibTmux.Window: A native window owner.;LibTmux.Pane: A native pane owner. - Outputs
-
LibTmux.TmuxOptionValue
Examples#
Example 1 Set the key mode on a previously selected native
$sessionand inspect its stored value. View sourceTerminal window $session | LibTmux\Set-TmuxOption -Name 'status-keys' -Value 'vi' -PassThru- Parameters
-
-
-Pane(LibTmux ) (for.Pane Pane) #The native pane whose table is used.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The tmux option name, optionally indexed. tmux expands formats in option names; this is not a literal wildcard selector. Whitespace-only names and NUL are rejected.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()- Validation
ValidatePattern("\\A[^\\x00]*[^\\s\\x00][^\\x00]*\\z")
-
-Scope(System.Nullable [LibTmux ]) #.Option Scope Override the owner scope with
Server,Session,WindoworPane. Omission uses the native owner scope.- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateSet(["Server","Session","Window","Pane"])
-
-Global(System.Management ) #.Automation .Switch Parameter Use the global table for the selected scope. For global session defaults from a
Server, specify ScopeSessionand Global.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
The value to store. Empty strings are allowed; NUL is rejected.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()- Validation
ValidatePattern("^[^\\x00]*$")
-
-Append(System.Management ) #.Automation .Switch Parameter Append to the existing value.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-ExpandFormat(System.Management ) #.Automation .Switch Parameter Expandtmux formats in the value before storing it.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-PreventOverwrite(System.Management ) #.Automation .Switch Parameter Ask tmux to refuse replacement of an existing option; refusal can be an error.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-PassThru(System.Management ) #.Automation .Switch Parameter Emit the native value read back after the mutation. Without this switch, emit no success output. Readback still occurs.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-Quiet(System.Management ) #.Automation .Switch Parameter Pass tmux its quiet flag. Missing reads emit no objects; suppressed writes may return an absent value with PassThru.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-WhatIf(System.Management ) #.Automation .Switch Parameter Show the selected owner, scope and operation without contacting tmux.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ) #.Automation .Switch Parameter Ask for confirmation before changing the selected table.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
cf
-
-Server(LibTmux ) (for.Server Server) #The native server whose table is used.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Session(LibTmux ) (for.Session Session) #The native session whose table is used.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Window(LibTmux ) (for.Window Window) #The native window whose table is used.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
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.TmuxOptionValue: The native stored value, only with PassThru.