it2 session lookup tab
Look up which tab contains a session
Synopsis
it2 session lookup tab [<session-id>] [flags]
Description
Look up which tab contains a session.
This command returns the tab 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 tab 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
- it2 session lookup - Look up session relationships and hierarchy
Examples
# Basic Usage
it2 session lookup tab
it2 session lookup tab sess_abc123
# Short format (first 8 characters)
it2 session lookup tab -s
# Scripting Example
TAB=$(it2 session lookup tab -q)
it2 tab focus "$TAB"