Skip to content

Commit e80229e

Browse files
committed
docs(CHANGES): Document Pane.capture_frame() for 0.52.x (#613)
why: Document the new capture_frame() method for users. what: - Add Pane.capture_frame() section under New features - Include usage example with textframe_snapshot - Document key features (default dimensions, truncate mode)
1 parent 9a1e104 commit e80229e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

CHANGES

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ def test_pane_output(textframe_snapshot):
9797
The `textframe_snapshot` fixture and assertion hooks are auto-discovered via
9898
pytest's `pytest11` entry point when the `textframe` extra is installed.
9999

100+
#### Pane.capture_frame() (#613)
101+
102+
New {meth}`~libtmux.pane.Pane.capture_frame` method that wraps
103+
{meth}`~libtmux.pane.Pane.capture_pane` and returns a
104+
{class}`~libtmux.textframe.TextFrame` for visualization and snapshot testing.
105+
106+
```python
107+
def test_cli_output(pane, textframe_snapshot):
108+
pane.send_keys("echo 'Hello'", enter=True)
109+
110+
# Wait for output, then capture as frame
111+
frame = pane.capture_frame(content_width=40, content_height=10)
112+
assert frame == textframe_snapshot
113+
```
114+
115+
**Features:**
116+
117+
- Defaults to pane dimensions when `content_width` / `content_height` not specified
118+
- Uses `overflow_behavior="truncate"` by default for CI robustness
119+
- Accepts same `start` / `end` parameters as `capture_pane()`
120+
100121
## libtmux 0.52.1 (2025-12-07)
101122

102123
### CI

0 commit comments

Comments
 (0)