# io.github.libtmux.Environment.Environment

- **Module:** io.github.libtmux.Environment
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Environment.java#L33
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-environment-environment/

The environment tmux gives to processes it starts, at one scope.

tmux keeps one environment per server and one per session, and hands the result to every
process it spawns afterwards. That is what this is for: a pane opened later sees what is set here,
so it is how a program refreshes a value that goes stale in a long-lived session — {@code
SSH_AUTH_SOCK} after reconnecting, a token, a display.

A scope is chosen when the view is obtained rather than passed to every call, as {@link
Options} does, so a caller cannot read one scope and write another. There are only the two scopes,
because tmux has only those two.

A name is in one of three states, and they are not the same question. It can be *set* to
a value, which {@link #get} answers. It can be *removed*, which is tmux's way of saying a
new process should not inherit it even though the server's own environment has it — {@link
#isRemoved} answers that, and {@link #get} is empty for it. Or it can simply be absent, which is
both of those empty.

## Members

- `global` (method)
- `session` (method)
- `get` (method): The value set for this name, or empty when it is removed or absent.
- `isRemoved` (method): Whether new processes are told not to inherit this name.
- `all` (method): Every name set at this scope, in tmux's order. Removed names are not values, so not here.
- `effective` (method): What a process started from this scope is actually handed, both scopes taken together.
- `removed` (method): Every name this scope tells a new process not to inherit.
- `set` (method): Sets a name to a literal value.
- `setExpanded` (method): Sets a name to what a tmux format expands to now.
- `unset` (method): Removes the name from this scope, so it is neither set nor marked.
- `remove` (method): Tells processes started after this not to inherit the name.
