# session.Session.window

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/session.rs#L836
- **Page:** https://libtmux.org/reference/rs/session-session-window/

```
session.Session.window(self, name: impl AsRef<[u8]>) -> Result<Option<Window>, Error>
```

Find this session's window with the given name.

Names are compared as bytes. A session can hold several windows with
one name, in which case the first in tmux's order is returned.

# Errors

Returns an error when the window listing fails.
