# client.Client

- **Module:** client
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/client.rs#L46
- **Page:** https://libtmux.org/en/rs/latest/reference/client-client/

One client attached to the tmux server.

Clients have no `$`-style id. tmux identifies them by the terminal they
occupy, so [`Client::name`] is the identity and is always present.

## Example

```rust
let guard = libtmux::test::TestServer::new().await?;
guard.server().new_session("work").await?;

// A session created without attaching has no client, which is the usual
// shape under test and under automation.
assert!(guard.server().clients().await?.is_empty());

guard.shutdown().await?;
```

## Members

- `name` (method): Return the client name, which is its terminal path.
- `tty` (method): Return the client's controlling terminal.
- `term_name` (method): Return the terminal type the client reports.
- `pid` (method): Return the client process id.
- `width` (method): Return the client width in cells.
- `height` (method): Return the client height in cells.
- `created` (method): Return when the client connected.
- `is_readonly` (method): Report whether the client is attached read-only.
- `is_control_mode` (method): Report whether the client is a control-mode client.
- `is_own` (method): Report whether this process opened this client itself.
- `refresh` (method): Replace this handle's snapshot with the client's current state.
- `refreshed` (method): Return a new handle holding the client's current state.
- `attached_session` (method): The session this client is attached to.
- `attached_window` (method): The current window of the session this client is attached to.
- `attached_pane` (method): The active pane of the current window of this client's session.
- `detach` (method): Detach this client from its server.
- `suspend` (method): Suspend this client, as if its user pressed the suspend key.
- `lock` (method): Lock this client's terminal.
- `redraw` (method): Redraw this client's terminal.
- `switch_to` (method): Point this client at another session.
- `get` (method): Read one field of this client's snapshot, named by the handle that filters it.
