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.

MoreLess about this notice

method libtmux-rs

Session.hide_environment

Hide a variable from processes started in this session.

Source and package
Qualified name
libtmux::session::Session::hide_environment
Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session/settings.rs
pub async fn hide_environment(&self, name: &str) -> Result< (), Error >
Completion
Returns a future that runs when awaited.signature · settings.rs:523
Errors
Returns an error when tmux rejects the name.doc comment · :498

Description

Different from Self::unset_environment(), which deletes the session's own entry and lets whatever tmux inherited show through. This keeps an entry and marks it, so a process started here is handed an environment with the name absent even though the tmux server has one. It is what EnvironmentEntry::Removed reports.

Errors

Returns an error when tmux rejects the name.

Parameters

Examples

use libtmux::EnvironmentEntry;
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("hidden").await?;
session.hide_environment("PAGER").await?;
assert_eq!(
session.environment_all().await?.get("PAGER"),
Some(&EnvironmentEntry::Removed),
);
guard.shutdown().await?;

Recorded calls

source calls
No call edges in the Rust model.

The Rust reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls session.Session.hide_environment.

tmux command

task material

The tmux commands behind hide_environment.

tmux C API

task material

The C declarations in tmux that implement these commands.

Esc
Search in

Type to search.

Reference previewOpen reference