|
29 | 29 | session_check_name,
|
30 | 30 | )
|
31 | 31 |
|
| 32 | +if t.TYPE_CHECKING: |
| 33 | + from typing_extensions import Literal, TypeAlias |
| 34 | + |
| 35 | + DashLiteral: TypeAlias = Literal["-"] |
| 36 | + |
32 | 37 | logger = logging.getLogger(__name__)
|
33 | 38 |
|
34 | 39 |
|
@@ -351,8 +356,8 @@ def new_session(
|
351 | 356 | start_directory: t.Optional[str] = None,
|
352 | 357 | window_name: t.Optional[str] = None,
|
353 | 358 | window_command: t.Optional[str] = None,
|
354 |
| - x: t.Optional[int] = None, |
355 |
| - y: t.Optional[int] = None, |
| 359 | + x: t.Optional[t.Union[int, "DashLiteral"]] = None, |
| 360 | + y: t.Optional[t.Union[int, "DashLiteral"]] = None, |
356 | 361 | *args: t.Any,
|
357 | 362 | **kwargs: t.Any,
|
358 | 363 | ) -> Session:
|
@@ -395,10 +400,10 @@ def new_session(
|
395 | 400 | when the command exits. NOTE: When this command exits the window
|
396 | 401 | will close. This feature is useful for long-running processes
|
397 | 402 | where the closing of the window upon completion is desired.
|
398 |
| - x : int, optional |
| 403 | + x : [int, str], optional |
399 | 404 | Force the specified width instead of the tmux default for a
|
400 | 405 | dettached session
|
401 |
| - y : int, optional |
| 406 | + y : [int, str], optional |
402 | 407 | Force the specified height instead of the tmux default for a
|
403 | 408 | dettached session
|
404 | 409 |
|
|
0 commit comments