# libtmux.neo._split_records

- **Module:** libtmux.neo
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/d2a146c9a045437b92013d65943b7ac70013fa24/src/libtmux/neo.py#L1046
- **Page:** https://libtmux.org/en/py/latest/reference/libtmux-neo-_split_records/

```
libtmux.neo._split_records(
    stdout: list[str], field_count: int
) -> list[str]
```

Regroup ``-F`` output into one string per object.

tmux writes one record per line, but any format value may itself
contain a newline -- [`pane_current_path`](/en/tmux/latest/catalog/formats/pane_current_path/) for a directory whose
name has one -- and that splits the record across output lines.
Iterating lines then hands :func:`parse_output` a fragment with too
few values, which its strict ``zip`` rejects, so one directory
breaks every object on the server rather than the one pane in it.

Regrouping on the separator is exact rather than merely better: the
template from :func:`get_output_format` terminates *every* field
with a separator, so one record holds exactly ``field_count`` of
them and a newline is never one. Nothing is split on newlines, so a
value may contain any number of them, in any position.

## Parameters

- `stdout` (`list[str]`)
- `field_count` (`int`)

## Raises

- [`LibTmuxException`](/en/py/latest/reference/libtmux-exc-libtmuxexception/): If the values do not divide into whole records, which means a
value contained the separator itself.
