Session.set_environment
Set an environment variable for processes this session starts.
Source and package
- Qualified name
-
libtmux::session:: Session:: set _environment - Module
- session
- Declared in
Session- Package
- libtmux
- Source
- crates/libtmux/src/session/settings.rs
- Other languages
- Perlmethod Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptGo Java C# C++ Swift Kotlin Scala OCaml F# Clojure
-
Description#
Existing panes keep the environment they were started with; this affects what new panes inherit.
The value is marked sensitive, since an environment carries tokens.
Errors
Returns an error when tmux rejects the name or value.
tmux command#
The tmux commands behind set_environment.
tmux C API#
The C declarations in tmux that implement these commands.
Guides#
Pages that discuss set_environment.
In other ports#
Set a variable in a session's environment
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | session |
| Go | tmux |
| Java | no equivalent on Session |
| C# | no equivalent on Session |
| C++ | no equivalent on Session |
| Swift | Server |
| OCaml | Libtmux |
| Perl | Lib Pass an explicit session ID. Empty text and zero-like text remain values. |
No equivalent is recorded in PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.