Skip to content

types: Add StrPath typing, fix new_session, part 2 #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libtmux/_internal/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Notes
-----
:class:`StrPath` and :class:`StrOrBytesPath` is based on `typeshed's`_.
:class:`StrPath` is based on `typeshed's`_.

.. _typeshed's: https://github.com/python/typeshed/blob/5ff32f3/stdlib/_typeshed/__init__.pyi#L176-L179
""" # E501
Expand Down
2 changes: 1 addition & 1 deletion src/libtmux/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def new_window(
window_args += ("-P",)

# Catch empty string and default (`None`)
if start_directory and isinstance(start_directory, str):
if start_directory:
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-window -c.
start_directory = pathlib.Path(start_directory).expanduser()
window_args += (f"-c{start_directory}",)
Expand Down