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

method libtmux

Format.escape

Return a format that tmux expands back to text.

Source and package
Qualified name
libtmux.Format.escape
Module
libtmux
Declared in
Format
Package
libtmux
Source
src/libtmux/formats.py

Description

The result stays literal inside an expression such as a conditional or comparison, though not inside #(...), where tmux counts parentheses for a shell command. A Format is returned unchanged.

Parameters

Examples

>>> Format.escape("x#S")
Format('x#{a:35}S')
>>> Format.escape(Format("#S"))
Format('#S')

Compare a window name with user text:

>>> user_text = "a,b"
>>> Format("#{==:#{window_name},") + Format.escape(user_text) + Format("}")
Format('#{==:#{window_name},a#{a:44}b}')

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.Format.escape.

Esc
Search in

Type to search.

Reference previewOpen reference