# tmux.Window.LastPane

- **Module:** tmux.Window
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/window_pane_topology.go#L213
- **Page:** https://libtmux.org/reference/go/tmux-window-lastpane/

```
tmux.Window.LastPane(ctx: context.Context, request: LastPaneRequest) -> (Pane, error)
```

LastPane targets the receiver's exact winlink. Its zero request makes the previously active pane active without selecting the window in its session. With an Input mode, tmux changes the previous pane's input state without selecting it; the returned [Pane] is still the freshly materialized active pane in the receiver context.

Command or refresh failures return zero because the active view needs refresh.
