# libtmux.Pane.capture_pane

- **Module:** libtmux.Pane
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/pane.py#L492
- **Page:** https://libtmux.org/reference/py/libtmux-pane-capture_pane/

```
libtmux.Pane.capture_pane(self, start: t.Literal["-"] | int | None = ..., end: t.Literal["-"] | int | None = ..., escape_sequences: bool = ..., escape_non_printable: bool = ..., join_wrapped: bool = ..., preserve_trailing: bool = ..., trim_trailing: bool = ..., alternate_screen: bool = ..., quiet: bool = ..., mode_screen: bool = ..., pending: bool = ..., hyperlinks: bool = ..., line_numbers: bool = ..., line_flags: bool = ..., to_buffer: str) -> None
```

Capture text from pane.

``$ tmux capture-pane`` to pane.
``$ tmux capture-pane -S -10`` to pane.
``$ tmux capture-pane -E 3`` to pane.
``$ tmux capture-pane -S - -E -`` to pane.

## Example

```python
>>> pane = window.split(shell='sh')
>>> pane.capture_pane()
['$']
```

## Example

```python
>>> pane.send_keys('echo "Hello world"', enter=True)
```

## Example

```python
>>> pane.capture_pane()
['$ echo "Hello world"', 'Hello world', '$']
```

## Example

```python
>>> print(chr(10).join(pane.capture_pane()))
$ echo "Hello world"
Hello world
$
```
