Core LibraryAPI Reference

Choose documentation 2

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

cmdlet libtmux-powershell latest

LibTmux.Set-TmuxEnvironment

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

Description#

An empty string sets a present, empty value. ExpandFormats expands 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 and IsRemoved false; this does not mean an empty or removed variable. Without PassThru, emit no success output. WhatIf does not contact tmux.

Notes

A Server selects the global environment; a Session selects 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 -WhatIf and -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 $session and inspect its readback. View source

Terminal window
$session |
LibTmux\Set-TmuxEnvironment -Name 'APP_MODE' -Value 'development' -PassThru
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.TmuxEnvironmentEntry : The native readback entry, only with PassThru.

Esc

Type to search.

Reference preview Open reference