# session.Session.last_window

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session.rs#L383
- **Page:** https://libtmux.org/en/rs/latest/reference/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.
