Skip to content

Commit 26c9003

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 4279182 commit 26c9003

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
@@ -317,7 +317,7 @@ def capture_pane(
317317
self,
318318
start: t.Literal["-"] | int | None = None,
319319
end: t.Literal["-"] | int | None = None,
320-
) -> str | list[str]:
320+
) -> list[str]:
321321
"""Capture text from pane.
322322
323323
``$ tmux capture-pane`` to pane.
@@ -344,7 +344,7 @@ def capture_pane(
344344
345345
Returns
346346
-------
347-
str | list[str]
347+
list[str]
348348
Captured pane content.
349349
"""
350350
cmd = ["capture-pane", "-p"]
@@ -412,7 +412,7 @@ def display_message(
412412
self,
413413
cmd: str,
414414
get_text: t.Literal[True],
415-
) -> str | list[str]: ...
415+
) -> list[str]: ...
416416

417417
@t.overload
418418
def display_message(self, cmd: str, get_text: t.Literal[False]) -> None: ...
@@ -421,7 +421,7 @@ def display_message(
421421
self,
422422
cmd: str,
423423
get_text: bool = False,
424-
) -> str | list[str] | None:
424+
) -> list[str] | None:
425425
"""Display message to pane.
426426
427427
Displays a message in target-client status line.
@@ -436,7 +436,7 @@ def display_message(
436436
437437
Returns
438438
-------
439-
str | list[str] | None
439+
list[str] | None
440440
Message output if get_text is True, otherwise None.
441441
"""
442442
if get_text:

0 commit comments

Comments
 (0)