# libtmux._internal.log_context._split_command_list

- **Module:** libtmux._internal.log_context
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/efdbb5637666b166358772ecc737b3807beab21e/src/libtmux/_internal/log_context.py#L171
- **Page:** https://libtmux.org/en/py/latest/reference/libtmux-_internal-log_context-_split_command_list/

```
libtmux._internal.log_context._split_command_list(
    tokens: Sequence[str],
    allow_attached_semicolon: bool = True,
) -> list[_CommandSegment]
```

Split per-command tokens on ``;``, preserving ``{ ... }`` blocks.

Mirrors ``cmd_parse_from_arguments`` in ``cmd-parse.y``: a standalone
``";"`` separates commands without joining either command's argv, an
argument ending in an unescaped ``";"`` (when *allow_attached_semicolon* is
True) loses that ``";"`` during inspection and ends the command, ``"\;"``
stays literal data, and ``;`` inside a matched ``{ ... }`` block stays
inside that block.

## Parameters

- `tokens` (`Sequence[str]`)
- `allow_attached_semicolon` (`bool`)
  Default: `True`.

## Examples

```python
>>> [
...     (s.tokens, s.standalone_semicolon)
...     for s in _split_command_list(["send-keys", "-R", ";", "clear-history"])
... ]
[(['send-keys', '-R'], True), (['clear-history'], False)]
>>> [
...     (s.tokens, s.attached_semicolon)
...     for s in _split_command_list(["new-window", "-eK=v;", "list-panes"])
... ]
[(['new-window', '-eK=v'], True), (['list-panes'], False)]
```
