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

_open_expression

Return which tmux expression template ends inside, if any.

Source and package
Qualified name
libtmux.formats._open_expression
Module
libtmux.formats
Package
libtmux
Source
src/libtmux/formats.py
_open_expression (template: str) → str | None

Description

Mirrors the scanner in tmux's format_expand1: #(...) closes at its balancing ), counting every ( inside it; #{...} closes as _skip() finds; a run of # before [ is a style.

Parameters

Examples

>>> _open_expression("#{session_name}-") is None
True
>>> _open_expression("#{?pane_active,")
'it ends inside #{...}'
>>> _open_expression("#(echo $(printf x)")
'it ends inside #(...)'
>>> _open_expression("#(echo $(printf x))") is None
True
>>> _open_expression("#[fg=")
'it ends inside #[...]'

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.formats._open_expression.

Esc
Search in

Type to search.

Reference previewOpen reference