Skip to content

Commit 5983e01

Browse files
committed
fix(cli[debug_info]): Guard empty strings in _private()
PrivatePath("") returns "." (current directory), which would show "shell: ." in debug-info output when SHELL env var is unset/empty. Now empty strings return "" like None does.
1 parent a0e2ada commit 5983e01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tmuxp/cli/debug_info.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ def _private(path: pathlib.Path | str | None) -> str:
8484
--------
8585
>>> _private(None)
8686
''
87+
>>> _private('')
88+
''
8789
>>> _private('/usr/bin/tmux')
8890
'/usr/bin/tmux'
8991
"""
90-
if path is None:
92+
if path is None or path == "":
9193
return ""
9294
return str(PrivatePath(path))
9395

0 commit comments

Comments
 (0)