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

tmuxp.cli.search.extract_workspace_fields

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

API reference · Markdown

tmuxp.cli.search.extract_workspace_fields ( filepath : pathlib.Path ) → WorkspaceFields
function [source]
function [source]
tmuxp.cli.search.extract_workspace_fields

Extract searchable fields from a workspace file.

Parses the workspace configuration and extracts name, path, session_name, window names, and pane commands for searching.

Examples

>>> import tempfile
>>> import pathlib
>>> content = '''
... session_name: my-project
... windows:
... - window_name: editor
... panes:
... - vim
... - shell_command: git status
... - window_name: shell
... '''
>>> with tempfile.NamedTemporaryFile(
... suffix='.yaml', delete=False, mode='w'
... ) as f:
... _ = f.write(content)
... temp_path = pathlib.Path(f.name)
>>> fields = extract_workspace_fields(temp_path)
>>> fields["session_name"]
'my-project'
>>> sorted(fields["windows"])
['editor', 'shell']
>>> 'vim' in fields["panes"]
True
>>> temp_path.unlink()
Parameters
Returns

WorkspaceFields Dictionary of extracted fields.

Esc

Type to search.