it2 window close

Close a window

Synopsis

it2 window close <window-id> [flags]

Examples

# Close a specific window
$ it2 window close window-123
# Close current window
$ it2 window close $(it2 window current)
# Force close without confirmation
$ it2 window close --force window-123
# Close all windows except current
$ for wid in $(it2 window list --format id); do
$ [[ "$wid" != "$(it2 window current)" ]] && it2 window close --force $wid
$ done
# Close oldest window
$ it2 window close $(it2 window list --format id | tail -1)

Options

--force

Force close without confirmation

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