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.finders.find_local_workspace_files

tmuxp.workspace.finders.find_local_workspace_files ( start_dir: pathlib.Path | str | None = None, stop_at_home: bool = True, ) → list[pathlib.Path]

Find .tmuxp.* files by traversing upward from start directory.

Description#

Searches the start directory and all parent directories up to (but not past):

  • User home directory (when stop_at_home=True)
  • Filesystem root

Examples#

>>> import tempfile
>>> import pathlib
>>> with tempfile.TemporaryDirectory() as tmpdir:
... home = pathlib.Path(tmpdir)
... project = home / "project"
... project.mkdir()
... _ = (project / ".tmuxp.yaml").write_text("session_name: test")
... # Would find .tmuxp.yaml in project dir
... len(find_local_workspace_files(project, stop_at_home=False)) >= 0
True
Parameters
Returns

list[pathlib.Path] List of workspace file paths found, ordered from closest to farthest.

Esc

Type to search.

Reference preview Open reference