it2 text get-buffer
Get buffer contents of a session (alias to 'session get-buffer')
Synopsis
it2 text get-buffer [<session-id>] [flags]
Description
Get buffer contents of a session including scrollback history.
Note: This command is an alias to 'it2 session get-buffer'.
The canonical location is now under session commands, but this alias
is maintained for backward compatibility.
Examples
# Get current session buffer
$ it2 text get-buffer
# Or use the canonical form:
$ it2 session get-buffer
# Get specific session buffer
$ it2 text get-buffer SESSION123
# Get last 100 lines only
$ it2 text get-buffer --lines 100
$ it2 text get-buffer --last 100
# Include color/formatting information
$ it2 text get-buffer --color
# Save session output to file
$ it2 text get-buffer > session-output.txt
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)
-
--include-empty-lines - Include trailing empty/blank lines in output (default: strip them)
-
--last(default 0) - Number of last lines to retrieve (alias for --lines)
-
--lines(default 10000) - Number of lines to retrieve
-
--scrollback - Include scrollback history
-
--timeout(default "5s") - Command timeout
-
--url(default "ws://localhost:1912") - iTerm2 WebSocket URL
See Also
- it2 text - Text and buffer operations in iTerm2
- it2 text clear-buffer - Clear screen buffer contents
- it2 text find - Find text in session buffer
- it2 text get-contents - Get specific line ranges from a session buffer
- it2 text get-cursor - Get cursor position and state
- it2 text get-screen - Get current screen contents of a session
- it2 text highlight - Temporarily highlight text patterns
- it2 text inject - Inject data into a session as if it came from the program
- it2 text replace - Replace text in session buffer
- it2 text search - Search buffer contents for patterns
- it2 text select - Control text selection in a session
- it2 text send - Send text to a session
- it2 text set-cursor - Set cursor position
- it2 text set-size - Set the terminal grid size for a session