it2 session process has

Check if a process exists in session's tree

Synopsis

it2 session process has <process-name> [<session-id>] [flags]

Description

Check if a process name exists in the session's process tree.

Returns exit code 0 if found, 1 if not found.

Examples:

Check if current session has vim

it2 session process has vim

Exact match only

it2 session process has --exact python

Quiet mode (exit code only)

it2 session process has --quiet node

Options

--depth (default 10)

Maximum depth to search in parent chain

--exact

Require exact match (no substring matching)

--quiet

Suppress output (only use exit code)

--verbose

Show detailed search information

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