# client.Client.attached_window

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

```
client.Client.attached_window(self) -> Result<Option<crate::Window>, Error>
```

The current window of the session this client is attached to.

Not this client's own view. tmux keeps the current window on the
session -- `curw` is a member of `struct session`, not of
`struct client` -- so every client attached to one session reports the
same window, and one client changing it changes it for all of them.

`None` when the client is attached to nothing.

Costs one tmux command, as [`Self::attached_session`] describes.

# Errors

Returns an error when tmux cannot be reached, or answers with an ID
this crate cannot parse.
