search
Scan a tmux session's logged output for regex or literal matches without reading it all. Get total hit counts plus line numbers, context, and regions for build errors, test failures, or trace values.
Instructions
Search session output (regex by default) without reading it all: what
grep would do on a log file you had redirected to. Use it for a
build's errors, a testsuite's FAIL lines, a value in a long trace --
after the command, or while it still runs.
Reports the total number of matching lines (so you know whether you
saw them all), then up to max_results of them (after skipping skip),
each with context lines around it, its line number (the number read start= takes) and the region it belongs to. Restrict to one region
with region.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skip | No | hits to skip first, for paging (the reply's "[more: skip=N]") | |
| region | No | search only this region's output; default: the whole session log | |
| context | No | lines shown before and after each hit (0: the hit alone) | |
| literal | No | take `pattern` as plain text, not a regex | |
| pattern | Yes | Python regex, tried against each line of the cooked log on its own (^ and $ anchor a line); the reply gives the total number of matching lines, then the hits in log order with their line numbers (usable as `read start=`) and regions | |
| session | Yes | the session's name (from session_create or session_list) | |
| ignore_case | No | match case-insensitively | |
| max_results | No | hits to show per call; the reply says how many there are in all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |