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.builder.resolve_builder_paths

tmuxp.workspace.builder.resolve_builder_paths ( session_config: dict[str, t.Any], workspace_file: str | os.PathLike[str] | None = None, ) → list[pathlib.Path]

Resolve and validate trusted workspace_builder_paths import roots.

Description#

Each entry is shell-expanded (~ and $VARS), resolved relative to the workspace file's directory when not absolute, and required to be an existing directory. Returns [] when the key is absent, so existing workspaces add nothing to sys.path.

Examples#

Absent key resolves to an empty list (no-op for existing workspaces):

>>> resolve_builder_paths({}, None)
[]

An existing directory is resolved:

>>> root = tmp_path / "roots"
>>> root.mkdir()
>>> resolve_builder_paths({"workspace_builder_paths": [str(root)]}, None) == [
... root.resolve()
... ]
True

A missing directory is rejected:

>>> resolve_builder_paths(
... {"workspace_builder_paths": [str(tmp_path / "missing")]}, None
... )
Traceback (most recent call last):
...
tmuxp.exc.WorkspaceBuilderPathError: ...
Parameters
Returns

list of pathlib.Path

Esc

Type to search.

Reference preview Open reference