# libtmux:last-window

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/selection.lisp#L38
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-last-window/

```
(last-window client session &key (observe t) cancel-token timeout output-limit)
```

Select SESSION's last active link; return an outcome with that observed link.
OBSERVE may omit follow-up acquisition. Tmux reports an error when no last
window exists. Signals STALE-TARGET or an operational condition. Earlier
captures retain their original selection.

## Parameters

- `client`
- `session`
- `observe?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `last-window`.

- [`last-window`](/en/tmux/latest/manual/last-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_last_window_entry`](/en/tmux/latest/reference/c-variable-cmd_last_window_entry/) (attribute)
- [`cmd_select_window_exec`](/en/tmux/latest/reference/c-function-cmd-select-window-c-cmd_select_window_exec/) (function)

## Guides

Pages that discuss `last-window`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
