Skip to content

Commit 6413708

Browse files
committed
Pane(fix[copy_mode]): -q cancels modes, -e exits on scroll to bottom
why: copy-mode -q cancels all modes (window_pane_reset_mode_all), not "quiet". And -e exits copy mode when scrolling reaches the bottom of history, not "exit on copy". Verified in cmd-copy-mode.c and tmux manpage. Internal tmux name for -e is scroll_exit. what: - Rename quiet param to cancel - Rename exit_on_copy param to exit_on_bottom - Update docstrings to reflect actual semantics
1 parent c1dad0a commit 6413708

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/libtmux/pane.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,22 +1428,23 @@ def copy_mode(
14281428
self,
14291429
*,
14301430
scroll_up: bool | None = None,
1431-
exit_on_copy: bool | None = None,
1431+
exit_on_bottom: bool | None = None,
14321432
mouse_drag: bool | None = None,
1433-
quiet: bool | None = None,
1433+
cancel: bool | None = None,
14341434
) -> None:
14351435
"""Enter copy mode via ``$ tmux copy-mode``.
14361436
14371437
Parameters
14381438
----------
14391439
scroll_up : bool, optional
14401440
Start scrolled up one page (``-u`` flag).
1441-
exit_on_copy : bool, optional
1442-
Exit copy mode after copying (``-e`` flag).
1441+
exit_on_bottom : bool, optional
1442+
Exit copy mode when scrolling reaches the bottom of the
1443+
history (``-e`` flag).
14431444
mouse_drag : bool, optional
14441445
Start mouse drag (``-M`` flag).
1445-
quiet : bool, optional
1446-
Quiet mode (``-q`` flag).
1446+
cancel : bool, optional
1447+
Cancel copy mode and any other modes (``-q`` flag).
14471448
14481449
Examples
14491450
--------
@@ -1458,13 +1459,13 @@ def copy_mode(
14581459
if scroll_up:
14591460
tmux_args += ("-u",)
14601461

1461-
if exit_on_copy:
1462+
if exit_on_bottom:
14621463
tmux_args += ("-e",)
14631464

14641465
if mouse_drag:
14651466
tmux_args += ("-M",)
14661467

1467-
if quiet:
1468+
if cancel:
14681469
tmux_args += ("-q",)
14691470

14701471
proc = self.cmd("copy-mode", *tmux_args)

0 commit comments

Comments
 (0)