Select window

select_window

select_window
mutating tool

Select (focus) a tmux window by ID, index, or direction.

Returns:

WindowInfo

Use when you need to switch focus to a different window — by ID, index, or direction (next, previous, last).

Side effects: Changes the active window in the session.

Example:

{
  "tool": "select_window",
  "arguments": {
    "direction": "next",
    "session_name": "dev"
  }
}

Response:

{
  "window_id": "@1",
  "window_name": "server",
  "window_index": "2",
  "session_id": "$0",
  "session_name": "dev",
  "pane_count": 1,
  "window_layout": "b25f,80x24,0,0,2",
  "window_active": "1",
  "window_width": "80",
  "window_height": "24"
}

Parameters

Parameter

Type

Required

Default

Description

window_id

str

no

Window ID (e.g. ‘@1’) for direct selection.

window_index

str

no

Window index for direct selection.

direction

enum

no

Relative direction: ‘next’, ‘previous’, or ‘last’. One of: 'next', 'previous', 'last'.

session_name

str

no

Session name for resolution.

session_id

str

no

Session ID for resolution.

socket_name

str

no

tmux socket name.

Destroy