Workspace ManagerstableAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

tmuxp.workspace.options.PaneReadiness

class tmuxp.workspace.options.PaneReadiness
Bases:

Policy for whether the builder waits for a pane's shell prompt.

Description#

tmuxp waits for each default-shell pane to draw its prompt before dispatching layout and commands, which avoids a zsh prompt-redraw artifact (see tmuxp.workspace.builder.classic._wait_for_pane_ready). The wait is only needed for zsh, so the default AUTO policy waits only when the session's interactive shell is zsh.

Members

AUTO = "auto"
ALWAYS = "always"
NEVER = "never"

Parse a pane_readiness config value into a policy.

Description#

Accepts the canonical auto / always / never strings, plus the truthy/falsy aliases users expect from boolean-like config keys.

Examples#

>>> PaneReadiness.from_config(None) is PaneReadiness.AUTO
True
>>> PaneReadiness.from_config("auto") is PaneReadiness.AUTO
True
>>> PaneReadiness.from_config(True) is PaneReadiness.ALWAYS
True
>>> PaneReadiness.from_config("on") is PaneReadiness.ALWAYS
True
>>> PaneReadiness.from_config(1) is PaneReadiness.ALWAYS
True
>>> PaneReadiness.from_config(False) is PaneReadiness.NEVER
True
>>> PaneReadiness.from_config("never") is PaneReadiness.NEVER
True

Unknown values raise an actionable error:

>>> PaneReadiness.from_config("sometimes")
Traceback (most recent call last):
...
ValueError: invalid pane_readiness value: 'sometimes'; expected one of:
auto, always/true/on/yes/1, never/false/off/no/0
Parameters
  • value (t.Any) # – value from workspace_builder_options.pane_readiness; None (key absent) resolves to AUTO

Returns

PaneReadiness

Esc

Type to search.

Reference preview Open reference