Set the environment for new panes
Needs libtmux for PowerShell 0.x Install
A server selects tmux’s global environment and a session selects its local one.
- Reads return that table’s entries without merging inherited values.
- Changes affect future processes, not one already running in a pane.
Read a stored value from a previously selected $session:
$session | Get-TmuxEnvironment -Name 'APP_MODE'Without -Name, it lists visible entries. Each is a TmuxEnvironmentEntry with
Name, Value and
IsRemoved. A missing variable produces no object.
Set a value for future panes and inspect the stored result:
$session | Set-TmuxEnvironment -Name 'APP_MODE' -Value 'development' -PassThruAn empty string is still a value. Without -PassThru, setting emits nothing.
-ExpandFormats asks tmux to expand the value as a format before storing it.
Forget the local entry so a global value can apply again:
$session | Remove-TmuxEnvironment -Name 'APP_MODE'Suppress inherited values in new pane processes instead:
$session | Remove-TmuxEnvironment -Name 'APP_MODE' -MarkRemoved-MarkRemoved keeps an entry with IsRemoved = true and Value = null.
Unsetting, marking removed and setting an empty string are three different tmux
operations.
Set-TmuxEnvironment -Hidden keeps a variable available to tmux formats but
leaves it out of new child environments and ordinary reads. Its -PassThru
result has Value = null and IsRemoved = false; null means readback is
unavailable, not that the variable is empty or removed.
Set and Remove support -WhatIf and -Confirm, and previews contact no server.
Errors keep the original core exception and owner. -ErrorAction Continue lets
later owners run, and Stop ends the pipeline. Cancellation
cannot undo a mutation already sent.