it2 session tail
Continuously monitor session output (like tail -f)
Synopsis
it2 session tail [<session-id>] [flags]
Description
Stream session output in real-time, similar to 'tail -f' for log files.
This command polls the session buffer at regular intervals and displays new content
as it appears. Useful for monitoring long-running commands or watching session output.
Examples
# Tail current session output
$ it2 session tail
# Tail specific session
$ it2 session tail abc123
# Tail with faster polling (every 500ms)
$ it2 session tail --interval 500ms
# Tail with initial context (show last 20 lines first)
$ it2 session tail --lines 20
# Tail and filter for errors
$ it2 session tail --grep error
# Tail and exclude debug messages
$ it2 session tail --grep-v DEBUG
# Case-insensitive pattern matching
$ it2 session tail --grep error --ignore-case
# Show only command output (hide prompts)
$ it2 session tail --output-only
# Tail multiple sessions side-by-side (in different terminals)
$ it2 session tail sess1 &
$ it2 session tail sess2 &
# Monitor build output with faster polling
$ it2 session tail build-session --interval 500ms --grep "✓\|✗"
Options
-
--color - Preserve ANSI color codes
-
-f,--follow (default true) - Follow output (disable to just show last N lines)
-
--format(default "table") - Output format (table|json|yaml|text)
-
--grep - Only show lines matching this pattern
-
--grep-v - Only show lines NOT matching this pattern
-
-i,--ignore-case - Case-insensitive pattern matching
-
--interval(default "1s") - Polling interval for new content
-
--lines(default 10) - Number of initial lines to show (0 for none)
-
--output-only - Hide command echoes and prompts, show only output
-
--timeout(default "5s") - Command timeout
-
--url(default "ws://localhost:1912") - iTerm2 WebSocket URL
See Also
- it2 session - Manage iTerm2 sessions
- it2 session autorespond - Monitor and automatically respond to session prompts
- it2 session badge - Manage session badges
- it2 session close - Close one or more sessions
- it2 session copy - Copy current selection to clipboard
- 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 get-buffer - Get buffer contents of a session
- 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 get-screen - Get current screen contents of a session
- it2 session has-shell-integration - Check if shell integration is enabled for a session
- it2 session list - List all iTerm2 sessions
- it2 session lookup - Look up session relationships and hierarchy
- it2 session monitor - Monitor session events in real-time
- it2 session move - Move a session to be a split pane next to another session
- it2 session paste - Paste clipboard content to session
- it2 session process - Process inspection for sessions
- it2 session profile - Manage session profile properties
- it2 session prompt - Get shell prompt metadata for a session
- it2 session resize - Resize a pane in a split layout
- it2 session restart - Restart a 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
- it2 session split - Split a session pane
- it2 session splits - Show split pane layout (moved to 'tab splits')
- it2 session title - Manage session titles
- it2 session variable - Manage session variables
- it2 session watch - Watch sessions and provide status overview