# LibTmux.Server.setEnvironment

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

```haskell
setEnvironment
  :: Server
  -> EnvironmentScope
  -> ByteString
  -> EnvironmentVisibility
  -> ByteString
  -> IO ()
```

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), [`EnvironmentVisibility`](/en/haskell/latest/reference/libtmux-environment-t-environmentvisibility/), [`IO`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:IO).

Set a literal value with explicit visibility. The name cannot be empty
 or contain NUL or `=`. Values cannot contain NUL. An empty value is valid.

## Referenced declarations

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

## tmux command

The tmux commands behind `setEnvironment`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_set_environment_entry`](/en/tmux/latest/reference/c-variable-cmd_set_environment_entry/) (attribute)
- [`cmd_set_environment_exec`](/en/tmux/latest/reference/c-function-cmd-set-environment-c-cmd_set_environment_exec/) (function)

## Guides

Pages that discuss `setEnvironment`.

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