read
Get terminal session output by line, region, screen row, or byte offset to inspect logs and full-screen programs without redirecting files.
Instructions
Read session output: the log or one region, by line number -- what
tail -n, sed -n or head would do on a log file you had redirected
to, except that nothing had to be redirected. A reply's "[... N lines
omitted (lines A-B) ...]" marker gives the range to read.
view="cooked" (default): the whole-session log as plain text with line
numbers, real line breaks only. With region, reads that region;
start is a line number (1-based, as shown) to page from. Without
start, shows the last limit lines.
view="screen": what the terminal shows right now, row by row as tmux
renders it (a long line wraps onto several rows), with the size and
cursor position. start/limit select screen rows. The view to use
for full-screen programs. Note that such programs clip long lines at
the window edge; check file contents another way.
view="raw": the bytes the program wrote, escape codes included, with
control characters spelled out (\e, \r, \xNN). For debugging odd
rendering. start is a byte offset; max_bytes bounds the result.
With region, reads that region's bytes (bounds may include a little
output from either side).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | No | "cooked" (the log as a plain-text file, one entry per real line), "screen" (the terminal as displayed now, rows as tmux renders them; for full-screen programs), or "raw" (the bytes written, escape codes spelled out) | cooked |
| limit | No | lines (or screen rows) to return; without `start`, the last that many | |
| start | No | cooked: the line number to start from (1-based, the numbers replies and `search` show; the same in a region and in the log); screen: the first row; raw: the byte offset | |
| region | No | read only this region (its id from a reply header or `regions`); default: the whole session log | |
| session | Yes | the session's name (from session_create or session_list) | |
| max_bytes | No | raw view only: the most bytes to return |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |