session.Session.hide_environment
Rust
- Python Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- session
- Declared in
- Session
- Package
- libtmux
- Source
- crates/libtmux/src/session/settings.rs
-
Hide a variable from processes started in this session.
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 whatEnvironmentEntry::Removedreports.Errors
Returns an error when tmux rejects the name.
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?;
0 declared, 0 inherited