Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

Server.environment

Read one variable from the server's environment.

Source and package
Qualified name
libtmux::server::Server::environment
Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server/settings.rs
Other languages
Perlmethod Rakumethod Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptGo Java C# C++ Swift Kotlin Scala OCamlfunction F# Clojure
pub async fn environment(&self, name: &str) -> Result< Option<EnvironmentEntry>, Error >

Description#

tmux keeps two different things under a name: a value, and a mark saying a process started from it must not inherit the name at all. EnvironmentEntry keeps them apart, because collapsing both to absence would hide the second, which a caller sets deliberately with Self::hide_environment().

None means tmux holds nothing under the name.

Errors

Returns an error when tmux cannot be reached.

Parameters

In other ports#

Read the server's global environment

Equivalents of Read the server's global environment in other languages
Language Equivalent
Python libtmux.Server.show_environment
Ruby LibTmux::Server#environment
Lua libtmux.Server:list_environment
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript server.Server.showEnvironment
Go tmux.Server.ShowEnvironment
Java no equivalent on Server
C# LibTmux.Server.Environment
C++ no equivalent on Server
Swift Server.environment(_:)
OCaml Libtmux_unix.Client.capture_environment Pass Environment.Global for server values or Environment.Session with a bound session target. Acquisition is explicit.
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.
Raku LibTmux::Configuration::Environment.list Use the corresponding server or session environment facade.

No equivalent is recorded in PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Read one variable from the server's environment

Equivalents of Read one variable from the server's environment in other languages
Language Equivalent
Python no single-variable read; the whole table is returned
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript server.Server.getEnvironment
Go tmux.Server.GetEnvironment
Java no single-variable read; the whole table is returned
C# no single-variable read; the whole table is returned
C++ no single-variable read; the whole table is returned
Swift no single-variable read; the whole table is returned
OCaml No direct public OCaml equivalent is recorded for this operation.
Perl LibTmux::Server::get_environment Omit session for the global environment. Missing or explicitly unset values remain failures.
Raku LibTmux::Configuration::Environment.get

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference