# pane.Pane.window

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

```
pane.Pane.window(self) -> Result<Option<Window>, Error>
```

Return the window that contains this pane.

This re-reads tmux, so a window renamed or moved since discovery is
reported as it is now. `Ok(None)` means the pane no longer has a
resolvable containing window.
For a linked window, tmux chooses the session context for the pane-ID
target rather than preserving this handle's cached session link.

# Errors

Returns an error when the parent lookup fails.
