it2 session
Manage iTerm2 sessions
Description
Commands for creating, listing, and managing iTerm2 sessions
Examples
Basic Session Information
$ it2 session list
$ it2 session current
Creating & Managing Sessions
$ it2 session split --horizontal
$ it2 session close sess_abc123
Display & Appearance
$ it2 session badge set "PROD"
$ it2 session title set "My Server"
Interaction
$ it2 session send-text sess_abc123 "echo hello"
$ it2 session send-key sess_abc123 enter
Monitoring
$ it2 session tail -f
Command Reference
Session Management Commands:
- it2 session close - Close one or more sessions
- it2 session current - Show the current session ID
- it2 session focus - Focus/activate a session
- it2 session focused - Get the currently focused session ID
- it2 session list - List all iTerm2 sessions
- it2 session lookup - Look up session relationships and hierarchy
- it2 session move - Move a session to be a split pane next to another session
- it2 session restart - Restart a session
- it2 session split - Split a session pane
Display & Appearance Commands:
- it2 session badge - Manage session badges
- it2 session resize - Resize a pane in a split layout
- it2 session title - Manage session titles
Session Interaction Commands:
- it2 session copy - Copy current selection to clipboard
- it2 session get-buffer - Get buffer contents of a session
- it2 session get-screen - Get current screen contents of a session
- it2 session paste - Paste clipboard content to session
- it2 session select - Select text in a session
- it2 session send-key - Send a special key to a session
- it2 session send-text - Send text to a session as if typed
Properties & Variables Commands:
- it2 session profile - Manage session profile properties
- it2 session variable - Manage session variables
Monitoring & Information Commands:
- it2 session autorespond - Monitor and automatically respond to session prompts
- it2 session get-info - Get comprehensive session information
- it2 session get-pid - Get the process ID (PID) of the shell in a session
- it2 session has-shell-integration - Check if shell integration is enabled for a session
- it2 session monitor - Monitor session events in real-time
- it2 session process - Process inspection for sessions
- it2 session prompt - Get shell prompt metadata for a session
- it2 session tail - Continuously monitor session output (like tail -f)
- it2 session watch - Watch sessions and provide status overview
Other Commands
- it2 session splits - Show split pane layout (moved to 'tab splits')
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 - iTerm2 CLI
- it2 app - Control the iTerm2 application
- it2 arrangement - Manage iTerm2 window arrangements
- it2 auth - Manage iTerm2 API authentication
- it2 badge - Manage session badges
- it2 broadcast - Manage broadcast domains
- it2 color - Manage iTerm2 colors and appearance
- it2 job - Monitor jobs in iTerm2 sessions
- it2 notification - Subscribe to iTerm2 notifications
- it2 profile - Manage iTerm2 profiles
- it2 prompt - Manage prompts and command history in iTerm2 sessions
- it2 selection - Text selection operations in iTerm2
- it2 statusbar - Manage iTerm2 status bar components
- it2 tab - Manage iTerm2 tabs
- it2 text - Text and buffer operations in iTerm2
- it2 tmux - Manage tmux integration
- it2 variable - Manage iTerm2 variables
- it2 window - Manage iTerm2 windows or navigate to window context