# window.navigation.Window.session

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

```
window.navigation.Window.session(self) -> Result<Option<Session>, Error>
```

Return the session this window was reached through.

This re-reads tmux rather than the snapshot, so a session renamed or
removed since discovery is reported as it is now. `Ok(None)` means the
session no longer exists.

# Errors

Returns an error when the session listing fails.
