# LibTmux::Async::Server::get_environment

- **Module:** LibTmux::Async
- **Package:** LibTmux-Async
- **Language:** Perl
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/async/lib/LibTmux/Async/Server.pm#L96
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-async-server-get_environment/

```
sub get_environment($self, %args)
```

See [`"get_environment" in LibTmux::Server`](/en/perl/latest/reference/libtmux-server-get_environment/) for arguments, returned value, and completion.

## Methods

## Parameters

- `args`

## tmux command

The tmux commands behind `get_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 one variable from the server's environment

| Language | Equivalent |
| --- | --- |
| Python | no single-variable read; the whole table is returned |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.getEnvironment`](/en/ts/latest/reference/server-server-getenvironment/) (method) |
| Rust | [`server.Server.environment`](/en/rs/latest/reference/server-server-environment/) (method) |
| Go | [`tmux.Server.GetEnvironment`](/en/go/latest/reference/tmux-server-getenvironment/) (method) |
| Java | no single-variable read; the whole table is returned |
| C# | no single-variable read; the whole table is returned |
| C++ | no single-variable read; the whole table is returned |
| Swift | no single-variable read; the whole table is returned |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Read one variable from a session's environment

| Language | Equivalent |
| --- | --- |
| Python | no single-variable read; the whole table is returned |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`session.Session.getEnvironment`](/en/ts/latest/reference/session-session-getenvironment/) (method) |
| Rust | [`session.Session.environment`](/en/rs/latest/reference/session-session-environment/) (method) |
| Go | [`tmux.Session.GetEnvironment`](/en/go/latest/reference/tmux-session-getenvironment/) (method) |
| Java | no single-variable read; the whole table is returned |
| C# | no single-variable read; the whole table is returned |
| C++ | no single-variable read; the whole table is returned |
| Swift | no single-variable read; the whole table is returned |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
