# session.Session.last_window

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

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

Move to the window that was active before this one, and return it.

`None` when nothing else has been active yet; see
[`Self::next_window`].

# Errors

Returns an error when tmux cannot be reached or refuses the move.
