it2 window list

List all iTerm2 windows

Synopsis

it2 window list [flags]

Description

List all iTerm2 windows with detailed information and filtering options.

Examples

# List all windows (table format)
$ it2 window list
# JSON format for scripting
$ it2 window list --format json
# Show specific columns
$ it2 window list --columns id,name,bounds
# Sort by window ID (descending)
$ it2 window list --sort id --reverse
# Output only window IDs (quiet mode)
$ it2 window list -q
# Use with xargs to close all windows
$ it2 window list -q | xargs -n1 it2 window close
# Count total windows
$ it2 window list -q | wc -l
# Find window by name pattern
$ it2 window list --format json | jq '.[] | select(.name | contains("Production"))'
# Get first window ID for scripting
$ FIRST_WINDOW=$(it2 window list --format json | jq -r '.[0].id')
# Export window layout for backup
$ it2 window list --format json > windows-backup.json
# Close all windows except the first
$ for window_id in $(it2 window list --format json | jq -r '.[1:][].id'); do
$   it2 window close "$window_id"
$ done
# Focus on specific window by name
$ WINDOW_ID=$(it2 window list --format json | jq -r '.[] | select(.name=="Development") | .id')
$ it2 window focus "$WINDOW_ID"

Options

--columns

Comma-separated list of columns to display (e.g., 'window id,name,bounds')
-q, --quiet
Output only window IDs

--reverse

Reverse sort order (descending)

--sort

Column to sort by (e.g., 'Window ID', 'Name', 'Frame')

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