# libtmux.Session:navigate_window

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Lua
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/_internal/entity.lua#L428
- **Page:** https://libtmux.org/en/lua/v0.1.1/reference/libtmux-session-navigate_window/

```
navigate_window: fun(
  self: libtmux.Session,
  direction: "last"|"next"|"previous",
  options?: libtmux.NavigateWindowOptions,
):libtmux.Request<boolean>
```

## Parameters

- `direction` (`"last"|"next"|"previous"`)
- `options` (`libtmux.NavigateWindowOptions?`)

## tmux command

The tmux commands behind `navigate_window`.

- [`last-window`](/en/tmux/latest/manual/last-window/) (the direction is "last")
- [`next-window`](/en/tmux/latest/manual/next-window/) (the direction is "next")
- [`previous-window`](/en/tmux/latest/manual/previous-window/) (the direction is "previous")

## 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)
- [`cmd_next_window_entry`](/en/tmux/latest/reference/c-variable-cmd_next_window_entry/) (attribute)
- [`cmd_previous_window_entry`](/en/tmux/latest/reference/c-variable-cmd_previous_window_entry/) (attribute)

## Guides

Pages that discuss `navigate_window`.

- [Topology operations](/en/lua/v0.1.1/guides/topology/)
