Skip to content

Commit 5142a84

Browse files
committed
pane(fix[typing]): Correct return types for capture_pane and display_message
why: The return type annotations incorrectly included `str` as a possible return type, but the implementation only ever returns `list[str]`. what: - Change capture_pane() return type from `str | list[str]` to `list[str]` - Change display_message() return type from `str | list[str] | None` to `list[str] | None` - Update corresponding docstring Returns sections
1 parent f82f97b commit 5142a84

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libtmux/pane.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def capture_pane(
321321
self,
322322
start: t.Literal["-"] | int | None = None,
323323
end: t.Literal["-"] | int | None = None,
324-
) -> str | list[str]:
324+
) -> list[str]:
325325
"""Capture text from pane.
326326
327327
``$ tmux capture-pane`` to pane.
@@ -348,7 +348,7 @@ def capture_pane(
348348
349349
Returns
350350
-------
351-
str | list[str]
351+
list[str]
352352
Captured pane content.
353353
"""
354354
cmd = ["capture-pane", "-p"]
@@ -416,7 +416,7 @@ def display_message(
416416
self,
417417
cmd: str,
418418
get_text: t.Literal[True],
419-
) -> str | list[str]: ...
419+
) -> list[str]: ...
420420

421421
@t.overload
422422
def display_message(self, cmd: str, get_text: t.Literal[False]) -> None: ...
@@ -425,7 +425,7 @@ def display_message(
425425
self,
426426
cmd: str,
427427
get_text: bool = False,
428-
) -> str | list[str] | None:
428+
) -> list[str] | None:
429429
"""Display message to pane.
430430
431431
Displays a message in target-client status line.
@@ -440,7 +440,7 @@ def display_message(
440440
441441
Returns
442442
-------
443-
str | list[str] | None
443+
list[str] | None
444444
Message output if get_text is True, otherwise None.
445445
"""
446446
if get_text:

0 commit comments

Comments
 (0)