it2 session lookup window

Look up which window contains a session

Synopsis

it2 session lookup window [<session-id>] [flags]

Description

Look up which window contains a session.

This command returns the window ID that contains the given session.

If no session ID is provided, uses the current session from ITERM_SESSION_ID.

Options

--json

Output result as JSON
-q, --quiet
Only output the window ID (for scripting)
-s, --short
Output only the first 8 characters of the ID

Options inherited from parent commands

--format (default "text")

Output format (text, json, yaml) - affects how command results are displayed

--timeout

Timeout for API operations - how long to wait for iTerm2 to respond

--url

WebSocket URL for iTerm2 API - typically ws://localhost:1912 for local iTerm2

See Also

Examples

  # Basic Usage

  it2 session lookup window
  it2 session lookup window sess_abc123

  # Short format (first 8 characters)

  it2 session lookup window -s

  # Scripting Example

  WINDOW=$(it2 session lookup window -q)
  it2 window focus "$WINDOW"