# select_window

Source: https://libtmux.org/en/rs/latest/mcp/tools/select_window/

> Select a window, making it its session's active window. Give a direction to move relative to it instead: next and previous step through the session in index order, and last returns to the previously active window. Change tmux state; no client-supplied executable input.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Select a window, making it its session’s active window. Give a direction to move relative to it instead: next and previous step through the session in index order, and last returns to the previously active window. Change tmux state; no client-supplied executable input.

[All Rust tools](https://libtmux.org/en/rs/latest/mcp/tools/) · [JSON](https://libtmux.org/en/rs/latest/mcp/tools/select_window.json) · [Source](https://github.com/libtmux/libtmux-rs/blob/2cef1aa642182dd1970c3688feb6a568ff666e64/crates/tmux-mcp/src/tools/control.rs#L475)

## Arguments

* `direction` optional

  Move relative to that window instead of selecting it. \`next\` and \`previous\` step through the session in index order, and \`last\` returns to the previously active window. Omit to select the named window itself.

* `window` required · string

  The \`@\`-prefixed window to select, or to move relative to.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema

```json
{
  "$defs": {
    "SelectWindowDirectionSchema": {
      "enum": [
        "next",
        "previous",
        "last"
      ],
      "type": "string"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "direction": {
      "anyOf": [
        {
          "$ref": "#/$defs/SelectWindowDirectionSchema"
        },
        {
          "type": "null"
        }
      ],
      "description": "Move relative to that window instead of selecting it.\n\n`next` and `previous` step through the session in index order, and\n`last` returns to the previously active window. Omit to select the\nnamed window itself."
    },
    "window": {
      "description": "The `@`-prefixed window to select, or to move relative to.",
      "type": "string"
    }
  },
  "required": [
    "window"
  ],
  "type": "object"
}
```

Output schema

```json
{
  "$defs": {
    "WindowView": {
      "description": "One window, as the protocol sees it.",
      "properties": {
        "active": {
          "description": "Whether this is the session's active window.",
          "type": "boolean"
        },
        "id": {
          "description": "The `@`-prefixed tmux identity.",
          "type": "string"
        },
        "index": {
          "description": "The window's index within that session.",
          "format": "int32",
          "type": "integer"
        },
        "linked": {
          "description": "Whether more than one session links this window.",
          "type": "boolean"
        },
        "name": {
          "description": "The window name.",
          "type": "string"
        },
        "panes": {
          "description": "How many panes the window holds.",
          "minimum": 0,
          "type": "integer"
        },
        "session_id": {
          "description": "The session this window was reached through.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "session_id",
        "index",
        "name",
        "panes",
        "active",
        "linked"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "windows": {
      "description": "The windows, in tmux's own order.",
      "items": {
        "$ref": "#/$defs/WindowView"
      },
      "type": "array"
    }
  },
  "required": [
    "windows"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Select Window"
}
```
