tmuxp debug-info - tmuxp.cli.debug_info

CLI for tmuxp debug-info subcommand.

class tmuxp.cli.debug_info.CLIDebugInfoNamespace(**kwargs)[source]

Bases: Namespace

Typed argparse.Namespace for tmuxp debug-info command.

color: CLIColorModeLiteral
output_json: bool
tmuxp.cli.debug_info.create_debug_info_subparser(parser)[source]

Augment argparse.ArgumentParser with debug-info subcommand.

Return type:

ArgumentParser

tmuxp.cli.debug_info._private(path)[source]

Privacy-mask a path by collapsing home directory to ~.

Return type:

str

Parameters:

path (pathlib.Path | str | None) – Path to mask.

Returns:

Path with home directory replaced by ~.

Return type:

str

Examples

>>> _private(None)
''
>>> _private('')
''
>>> _private('/usr/bin/tmux')
'/usr/bin/tmux'
tmuxp.cli.debug_info._collect_debug_info()[source]

Collect debug information as a structured dictionary.

All paths are privacy-masked using PrivatePath (home → ~).

Return type:

dict[str, Any]

Returns:

Debug information with environment, versions, paths, and tmux state.

Return type:

dict[str, Any]

Examples

>>> data = _collect_debug_info()
>>> 'environment' in data
True
>>> 'tmux_version' in data
True
tmuxp.cli.debug_info._format_human_output(data, colors)[source]

Format debug info as human-readable colored output.

Return type:

str

Parameters:
  • data (dict[str, Any]) – Debug information dictionary.

  • colors (Colors) – Color manager for formatting.

Returns:

Formatted human-readable output.

Return type:

str

Examples

>>> from tmuxp.cli._colors import ColorMode, Colors
>>> colors = Colors(ColorMode.NEVER)
>>> data = {
...     "environment": {
...         "dist": "Linux",
...         "arch": "x86_64",
...         "uname": ["Linux", "host", "6.0"],
...         "version": "#1 SMP",
...     },
...     "python_version": "3.12.0",
...     "system_path": "/usr/bin",
...     "tmux_version": "3.4",
...     "libtmux_version": "0.40.0",
...     "tmuxp_version": "1.50.0",
...     "tmux_path": "/usr/bin/tmux",
...     "tmuxp_path": "~/tmuxp",
...     "shell": "/bin/bash",
...     "tmux": {
...         "sessions": [],
...         "windows": [],
...         "panes": [],
...         "global_options": [],
...         "window_options": [],
...     },
... }
>>> output = _format_human_output(data, colors)
>>> "environment" in output
True
tmuxp.cli.debug_info.command_debug_info(args=None, parser=None)[source]

Entrypoint for tmuxp debug-info to print debug info to submit with issues.

Return type:

None