# update-environment

Source: https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/

> Set list of environment variables to be copied into the session environment when a new session is created or an existing session is attached.

option tmux3.2a

Set list of environment variables to be copied into the session environment when a new session is created or an existing session is attached.

* Scope

  session

* Type

  Text, array of values

* Default

  `DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY`

* Set

  [`set-option`](https://libtmux.org/en/tmux/3.2a/manual/set-option/) `update-environment value`

* Read

  [`show-options`](https://libtmux.org/en/tmux/3.2a/manual/show-options/) `update-environment`

## Description[#](https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/#description)

Set list of environment variables to be copied into the session environment when a new session is created or an existing session is attached. Any variables that do not exist in the source environment are set to be removed from the session environment (as if `-r` was given to the [`set-environment`](https://libtmux.org/en/tmux/3.2a/manual/set-environment/) command).

## Releases[#](https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/options/update-environment/) : default a longer value to a longer value
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/) : present

## Source[#](https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/#source)

* Defined in

  [`options-table.c:708`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/options-table.c#L708)

* C source reference

  [`options_table`](https://libtmux.org/en/tmux/3.2a/reference/c-variable-options_table/)

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/3.2a/manual/full/#options-update-environment)

## Used by[#](https://libtmux.org/en/tmux/3.2a/catalog/options/update-environment/#used-by)

Library documentation that names this option.

* Lua

  [`libtmux.SwitchClientOptions.update_environment`](https://libtmux.org/en/lua/latest/reference/libtmux-switchclientoptions-update_environment/)

* Rust

  [`options.generated.UPDATE_ENVIRONMENT`](https://libtmux.org/en/rs/latest/reference/options-generated-update_environment/)

* Go

  [`tmux.GlobalSessionScope.SetUpdateEnvironment`](https://libtmux.org/en/go/latest/reference/tmux-globalsessionscope-setupdateenvironment/), [`tmux.Session.SetUpdateEnvironment`](https://libtmux.org/en/go/latest/reference/tmux-session-setupdateenvironment/), [`tmux.SessionOptionValues.UpdateEnvironment`](https://libtmux.org/en/go/latest/reference/tmux-sessionoptionvalues-updateenvironment/)
