it2 session current
Show the current session ID
Synopsis
it2 session current [flags]
Description
Display the ID of the current iTerm2 session from ITERM_SESSION_ID environment variable
Options
-
-s,--short - Output only the first 8 characters of the session 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 - Manage iTerm2 sessions
Examples
# Basic Usage
it2 session current
# Short form (first 8 characters)
it2 session current --short
# Scripting Example
SESSION=$(it2 session current)
it2 session title set "$SESSION" "My Title"