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

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

Command Reference

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