it2 session close

Close one or more sessions

Synopsis

it2 session close <session-id> [<session-id>...] [flags]

Description

Close the specified iTerm2 session(s). Use --force to close without prompting

Examples

# Close a specific session
$ it2 session close abc123
# Close multiple sessions
$ it2 session close abc123 def456 ghi789
# Close current session
$ it2 session close $ITERM_SESSION_ID
# Force close without confirmation
$ it2 session close --force abc123
# Close with JSON output
$ it2 session close --format json abc123
# Close all sessions in window
$ IT2_SCOPE=window it2 session close $(it2 session list --format id)

Options

--dry-run

Show what would be affected without executing

--force

Force close the session without prompting

--format (default "table")

Output format (table|json|yaml|text)

--scope

Override IT2_SCOPE env var (none,window,tab,parents,siblings,peers,lineage)

--stop-on-error

Stop on first error instead of continuing

--timeout (default "5s")

Command timeout

--url (default "ws://localhost:1912")

iTerm2 WebSocket URL

See Also