# tmux_session:select/3

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_session.erl#L137
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_session-select-3/

```
select(Session, Client, Options)
-spec select(tmux_model:session(),
             binary(),
             select_options()) ->
                {ok, map()} | {error, map()}.
```

Switch one attached client, selected by its literal native client name or TTY path, to the session's registered stable ID. Performs I/O and returns the command result; existing rows remain captured values. Obtain the name from the caller's own client context, such as tmux's [`client_name`](/en/tmux/latest/catalog/formats/client_name/) format. There is no default client and this call never attaches one.

`update_environment` defaults to false ([`switch-client -E`](/en/tmux/latest/manual/switch-client/)). When true, tmux
updates the destination session environment using its [`update-environment`](/en/tmux/latest/catalog/options/update-environment/)
option and that client's environment; listed variables absent from the client
can be marked for removal. Running pane processes retain their environment.

Names are nonempty NUL-free binaries of at most 32 KiB. Trailing-colon aliases
are rejected. Native lookup matches an exact name or TTY path, including its
`/dev/`-relative alias; there is no prefix or pattern matching. A disconnected
name returns `client_not_found`. Names and TTY paths can be reused by a later
connection; this API does not identify a client incarnation atomically. A
missing destination returns `target_gone`. See `tmux_server:bind/2` for detached
session rows and `tmux_window_link:select/1` for window selection.

## Parameters

- `Session` (`tmux_model:session()`)
- `Client` (`binary()`)
- `Options` (`select_options()`)

## tmux command

The tmux commands behind `select/3`.

- [`switch-client`](/en/tmux/latest/manual/switch-client/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_switch_client_entry`](/en/tmux/latest/reference/c-variable-cmd_switch_client_entry/) (attribute)
- [`cmd_switch_client_exec`](/en/tmux/latest/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/) (function)

## Guides

Pages that discuss `select/3`.

### Concepts

- [Object graph](/en/erlang/latest/concepts/object-graph/)

### Guides

- [Native API documentation](/en/erlang/latest/guides/api-documentation/)
