LibTmux.Set-TmuxEnvironment
LibTmux\Set-TmuxEnvironment Set a tmux environment variable for future processes or formats.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/SetTmuxEnvironmentCommand.cs
- Server (default): Set-TmuxEnvironment [-Server] <Lib
Tmux > -Name <System.Server .String > -Value <System.String > [-ExpandFormats ] [-Hidden] [-PassThru ] [-WhatIf ] [-Confirm] [<CommonParameters >] Session: Set-TmuxEnvironment [-Session] <LibTmux > -Name <System.Session .String > -Value <System.String > [-ExpandFormats ] [-Hidden] [-PassThru ] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
An empty string sets a present, empty value.
ExpandFormatsexpands tmux formats before storage. Hidden keeps the variable for tmux formats and excludes it from new child process environments and ordinary reads. With Hidden and PassThru, the native readback entry has Value null andIsRemovedfalse; this does not mean an empty or removed variable. Without PassThru, emit no success output.WhatIfdoes not contact tmux.Notes
A
Serverselects the global environment; aSessionselects its local environment. Reads do not merge those tables. Changes affect newly created processes and do not rewrite the environment of an existing pane process. Empty owner pipelines do no I/O. Errors retain the original exception and owner; Continue permits later owners and Stop terminates. Cancellation cannot undo a dispatched mutation.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. - Outputs
-
LibTmux.TmuxEnvironmentEntry
Examples#
Example 1 Set a value for future processes in a native
$sessionand inspect its readback. View sourceTerminal window $session |LibTmux\Set-TmuxEnvironment -Name 'APP_MODE' -Value 'development' -PassThru- Parameters
-
-
-Server(LibTmux ) (for.Server Server) #The native server whose table is used.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The environment variable name. Omit Name on Get to list this table. Whitespace-only names and NUL are rejected.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()- Validation
ValidatePattern("\\A[^\\x00]*[^\\s\\x00][^\\x00]*\\z")
-
The value to store. Empty strings are allowed; NUL is rejected.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()- Validation
ValidatePattern("^[^\\x00]*$")
-
-ExpandFormats(System.Management ) #.Automation .Switch Parameter Expandtmux formats in the value before storage.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-Hidden(System.Management ) #.Automation .Switch Parameter Keep the variable for tmux formats, excluding it from child environments and ordinary reads.
- 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
-
-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
-
-Session(LibTmux ) (for.Session Session) #The native session 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.TmuxEnvironmentEntry: The native readback entry, only with PassThru.