# tmux.Session.LastWindow

- **Module:** tmux.Session
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/session_navigation.go#L28
- **Page:** https://libtmux.org/reference/go/tmux-session-lastwindow/

```
tmux.Session.LastWindow(ctx: context.Context) -> (Window, error)
```

LastWindow makes the receiver session's previously selected winlink current and returns that freshly materialized session-specific [Window]. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window because this navigation operation cannot identify the selected view reliably without refresh.
