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

session.Session.showEnvironment

TypeScript

View as Markdown

Module
session
Declared in
Session
Package
libtmux
Source
packages/libtmux/src/session.ts
Other languages
PythonRubyLuaRustGo Java .NET C++ Swift
showEnvironment ( ) → Promise<ReadonlyMap<string, EnvironmentValue>>
method [source]
method [source]
showEnvironment

Every variable in this session's environment.

A null value is tmux's -NAME: present, and marked for removal from any process tmux starts.

Discussed in Environment

In other ports Read a session's environment

Examples

const environment = await session.showEnvironment();
environment.get("EDITOR");
use libtmux::EnvironmentEntry;
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("read").await?;
assert_eq!(session.environment("EDITOR").await?, None);
session.set_environment("EDITOR", "hx").await?;
assert!(matches!(
session.environment("EDITOR").await?,
Some(EnvironmentEntry::Set(value)) if value.as_bytes() == b"hx",
));
session.hide_environment("EDITOR").await?;
assert_eq!(
session.environment("EDITOR").await?,
Some(EnvironmentEntry::Removed),
);
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.