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

tmuxp.workspace.finders.find_local_workspace_files

Python
  • Python
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

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

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

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
  • start_dir ( pathlib.Path | str | None ) – Directory to start searching from. Defaults to current working directory.

  • stop_at_home ( bool ) – If True, stops traversal at user home directory. Default True.

Returns

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

Esc

Type to search.