Skip to content

Commit 07627b8

Browse files
committed
Window(fix[last_pane]): correct flag mapping for -d/-e flags
why: last-pane -d disables input and -e enables input per tmux source (cmd-select-pane.c). The parameters were misnamed: detach mapped to -d (actually disables input, not detach) and disable_input mapped to -e (actually enables input). There is no "detach" flag for last-pane. what: - Replace detach/disable_input params with disable_input(-d)/enable_input(-e) - Match the pattern used by Pane.select() which already maps these correctly - Update docstrings and versionadded annotations
1 parent 0ee982b commit 07627b8

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/libtmux/window.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,24 +406,24 @@ def resize(
406406
def last_pane(
407407
self,
408408
*,
409-
detach: bool | None = None,
410-
keep_zoom: bool | None = None,
411409
disable_input: bool | None = None,
410+
enable_input: bool | None = None,
411+
keep_zoom: bool | None = None,
412412
) -> Pane | None:
413413
"""Select the last (previously active) pane via ``$ tmux last-pane``.
414414
415415
Parameters
416416
----------
417-
detach : bool, optional
418-
Do not make the pane active (``-d`` flag).
417+
disable_input : bool, optional
418+
Disable input to the pane (``-d`` flag).
419419
420420
.. versionadded:: 0.45
421-
keep_zoom : bool, optional
422-
Keep the window zoomed if zoomed (``-Z`` flag).
421+
enable_input : bool, optional
422+
Enable input to the pane (``-e`` flag).
423423
424424
.. versionadded:: 0.45
425-
disable_input : bool, optional
426-
Disable input to the pane (``-e`` flag).
425+
keep_zoom : bool, optional
426+
Keep the window zoomed if zoomed (``-Z`` flag).
427427
428428
.. versionadded:: 0.45
429429
@@ -442,15 +442,15 @@ def last_pane(
442442
"""
443443
tmux_args: tuple[str, ...] = ()
444444

445-
if detach:
445+
if disable_input:
446446
tmux_args += ("-d",)
447447

448+
if enable_input:
449+
tmux_args += ("-e",)
450+
448451
if keep_zoom:
449452
tmux_args += ("-Z",)
450453

451-
if disable_input:
452-
tmux_args += ("-e",)
453-
454454
proc = self.cmd("last-pane", *tmux_args)
455455

456456
if proc.stderr:

0 commit comments

Comments
 (0)