# LibTmux::Session#environment

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/da7b6191b9439e3c84fa1c9eeaa9168263ee7af4/gems/libtmux/lib/libtmux/operations.rb#L279
- **Page:** https://libtmux.org/en/ruby/v0.1.1/reference/libtmux-session-environment/

```
def environment: (
  ::String,
  ?hidden: bool,
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::String?
```

Behavior: Environment.

Behavior contract: Environment.

## Parameters

- `arg1` (`::String`)
- `hidden` (`bool`)
- `timeout` (`::Numeric`)
- `cancel` (`untyped`)

## tmux command

The tmux commands behind `environment`.

- [`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)

## In other ports

Read a session's environment

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.show_environment`](/en/py/latest/reference/libtmux-session-show_environment/) (method) |
| Lua | [`libtmux.Session:list_environment`](/en/lua/latest/reference/libtmux-session-list_environment/) (method) |
| TypeScript | [`session.Session.showEnvironment`](/en/ts/latest/reference/session-session-showenvironment/) (method) |
| Rust | [`session.Session.environment`](/en/rs/latest/reference/session-session-environment/) (method) |
| Go | [`tmux.Session.ShowEnvironment`](/en/go/latest/reference/tmux-session-showenvironment/) (method) |
| Java | no equivalent on `Session` |
| C# | [`LibTmux.Session.Environment`](/en/csharp/latest/reference/libtmux-session-environment/) (property) |
| C++ | no equivalent on `Session` |
| Swift | [`Server.environment(_:)`](/en/swift/latest/reference/server-environment(_-)/) (method) |

No equivalent is recorded in PowerShell, Julia, Elixir, Kotlin, Scala or F#.
