it2 session variable
Manage session variables
Description
Get, set, list, and clear session variables.
Variables provide a way to store metadata and custom information
associated with sessions. User-defined variables must begin with 'user.'.
Common session variables:
- session.hostname: The hostname
- session.username: The username
- session.path: Current working directory
- profileName: Profile name
- user.*: Custom user-defined variables
Commands
- it2 session variable clear - Clear a session variable
- it2 session variable get - Get a session variable value
- it2 session variable list - List all variables for a session
- it2 session variable set - Set a session variable value
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
# Query Variables
it2 session variable get $SESSION user.environment
it2 session variable list $SESSION
# Modify Variables
it2 session variable set $SESSION user.environment "production"
it2 session variable clear $SESSION user.environment