# LibTmux.Server.getEnvironment

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/72edb54317bf619c6dc54bff311844f062f8984c/src/LibTmux/Server.hs#L500
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-server-v-getenvironment/

```haskell
getEnvironment
  :: Server
  -> EnvironmentScope
  -> ByteString
  -> IO (Maybe EnvironmentEntry)
```

Signature types: [`Server`](/en/haskell/latest/reference/libtmux-server-t-server/), [`EnvironmentScope`](/en/haskell/latest/reference/libtmux-environment-t-environmentscope/), [`ByteString`](https://hackage.haskell.org/package/bytestring-0.12.2.0/docs/Data-ByteString.html#t:ByteString), [`IO`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:IO), [`Maybe`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Data-Maybe.html#t:Maybe), [`EnvironmentEntry`](/en/haskell/latest/reference/libtmux-environment-t-environmententry/).

Look up one name in the selected tmux environment. A removal marker and
 an empty value are present entries. A missing name returns [Nothing](https://hackage.haskell.org/package/base-4.22.0.0/docs/Data-Maybe.html#v:Nothing). A
 missing session raises [`EnvironmentReadRejected`](/en/haskell/latest/reference/libtmux-server-v-environmentreadrejected/). Bytes stay literal.
 The Server capture deadline covers ordinary and hidden value observations.

## Referenced declarations

- [`LibTmux.Environment.EnvironmentEntry`](/en/haskell/latest/reference/libtmux-environment-t-environmententry/) (data type)
- [`LibTmux.Environment.EnvironmentScope`](/en/haskell/latest/reference/libtmux-environment-t-environmentscope/) (data type)
- [`LibTmux.Server.Server`](/en/haskell/latest/reference/libtmux-server-t-server/) (data type)

## tmux command

The tmux commands behind `getEnvironment`.

- [`show-environment`](/en/tmux/latest/manual/show-environment/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_show_environment_entry`](/en/tmux/latest/reference/c-variable-cmd_show_environment_entry/) (attribute)
- [`cmd_show_environment_exec`](/en/tmux/latest/reference/c-function-cmd-show-environment-c-cmd_show_environment_exec/) (function)

## Guides

Pages that discuss `getEnvironment`.

- [Change targets and observe pane text](/en/haskell/latest/guides/mutations/)
- [Implementation status](/en/haskell/latest/guides/status/)
