Core Library0.xAPI reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

function libtmux

_split_records

Regroup -F output into one string per object.

Source and package
Qualified name
libtmux.neo._split_records
Module
libtmux.neo
Package
libtmux
Source
src/libtmux/neo.py
_split_records ( stdout: list[str], field_count: int ) → list[str]

Description

tmux writes one record per line, but any format value may itself contain a newline -- pane_current_path for a directory whose name has one -- and that splits the record across output lines. Iterating lines then hands 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 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
Raises
  • LibTmuxException – If the values do not divide into whole records, which means a value contained the separator itself.

Recorded calls

source calls
No call edges in the Python model.

The Python reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls libtmux.neo._split_records.

Esc
Search in

Type to search.

Reference previewOpen reference