# tmux_session:select/2

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

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

Switch an explicitly named attached client to this registered session, preserving the session environment. Performs I/O. See `select/3` for client lookup, environment updates and disconnection races.

An empty client name cannot select an implicit current client:

## Examples

```erlang
1> tmux_session:select(invalid_session, <<>>).
{error,#{code => invalid_client,path => [client]}}
```

## Parameters

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

## Guides

Pages that discuss `select/2`.

### Concepts

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

### Guides

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