session.Session.showEnvironment
- 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>>
-
Every variable in this session's environment.
A
nullvalue 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
- Python
libtmux.Session.show_environment - Ruby
LibTmux::Session#environment - Lua
libtmux.Session:list_environment - Rust
session.Session.environment - Go
tmux.Session.ShowEnvironment - Java no equivalent on
Session - .NET
LibTmux.Session.Environment - C++ no equivalent on
Session - Swift
Server.environment(_:)
- Python
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