it2 get-screen
Get current screen contents (shortcut for session get-screen)
Synopsis
it2 get-screen [<session-id>] [flags]
Description
Get the current visible screen contents of a session without scrollback history.
If no session-id is provided, uses $ITERM_SESSION_ID environment variable.
This is a convenience wrapper for 'it2 session get-screen'.
Use --wait-stable to wait until the screen contents stabilize before capturing.
This is useful for automation scenarios where you need to wait for command output
to complete before capturing the screen.
Stability options:
--wait-stable - Normal tolerance (2s), max-wait 10s
--wait-stable --wait-stable-tolerance=low - Quick detection (500ms), max-wait 10s
--wait-stable --wait-stable-tolerance=high - Lenient (5s), max-wait 10s
--wait-stable --wait-stable-max-wait=30s - Normal tolerance (2s), but max 30s total
Options
-
--color - Include ANSI color codes in output
-
--escaped - Show escape sequences as visible characters (like cat -v)
-
--format(default "table") - Output format (table|json|yaml|text)
-
--poll-interval(default "200ms") - Interval between screen polls when waiting for stability
-
--timeout(default "5s") - Command timeout
-
--url(default "ws://localhost:1912") - iTerm2 WebSocket URL
-
--wait-stable - Wait until screen is stable (uses --wait-stable-tolerance for timing)
-
--wait-stable-max-wait(default "10s") - Maximum total time to wait for stability (default: 10s). 0 for no limit
-
--wait-stable-tolerance(default "normal") - Stability tolerance level: low (500ms), normal (2s), high (5s)
See Also
- it2 - iTerm2 API Command-Line Interface
Examples
# Get immediate screen contents
$ it2 get-screen
# Get specific session screen
$ it2 get-screen E0A8
# Include color information
$ it2 get-screen --color
# Wait for screen to stabilize (default 2s tolerance)
$ it2 get-screen --wait-stable
# Quick detection with low tolerance (500ms)
$ it2 get-screen --wait-stable --wait-stable-tolerance=low
# Wait with custom max timeout
$ it2 get-screen --wait-stable --wait-stable-max-wait=30s