# libtmux.neo.parse_output

- **Module:** libtmux.neo
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/neo.py#L607
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-neo-parse_output/

```
libtmux.neo.parse_output(
    output: str,
    list_cmd: str = "list-panes",
    tmux_version: str = "3.2a",
) -> OutputRaw
```

Parse a tmux ``-F`` line into a dict keyed by Obj field name.

The (*list_cmd*, *tmux_version*) pair must match what was passed to
:func:`get_output_format` when the ``-F`` template was built —
otherwise the field order won't line up with the split values.

## Examples

```python
>>> from libtmux.neo import get_output_format, parse_output
>>> from libtmux.formats import FORMAT_SEPARATOR
>>> fields, fmt = get_output_format("list-sessions", "3.6a")
>>> values = [''] * len(fields)
>>> values[fields.index('session_id')] = '$1'
>>> result = parse_output(
...     FORMAT_SEPARATOR.join(values) + FORMAT_SEPARATOR,
...     list_cmd="list-sessions",
...     tmux_version="3.6a",
... )
>>> result['session_id']
'$1'
>>> 'pane_id' in result
False
```

## Parameters

- `output` (`str`): Raw tmux output line produced with a template from
:func:`get_output_format`.
- `list_cmd` (`str`): Same value passed to :func:`get_output_format`.
- `tmux_version` (`str`): Same value passed to :func:`get_output_format`.

## Returns

OutputRaw
    A dict mapping field names to non-empty string values.
