# server.settings.Server.environment

- **Module:** server.settings.Server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/server/settings.rs#L220
- **Page:** https://libtmux.org/reference/rs/server-settings-server-environment/

```
server.settings.Server.environment(self, name: &str) -> Result<Option<EnvironmentEntry>, Error>
```

Read one variable from the server's environment.

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.
