Skip to content

Commit c1dad0a

Browse files
committed
Pane(fix[clear_history]): -H resets hyperlinks, not clears pane content
why: clear-history -H calls screen_reset_hyperlinks(), removing OSC 8 hyperlinks. It does not clear visible pane content. Verified in cmd-capture-pane.c:226. what: - Rename clear_pane param to reset_hyperlinks - Update docstring and warning message
1 parent 6bd8a62 commit c1dad0a

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/libtmux/pane.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,14 +1967,13 @@ def swap(
19671967
if proc.stderr:
19681968
raise exc.LibTmuxException(proc.stderr)
19691969

1970-
def clear_history(self, *, clear_pane: bool | None = None) -> None:
1970+
def clear_history(self, *, reset_hyperlinks: bool | None = None) -> None:
19711971
"""Clear pane history buffer via ``$ tmux clear-history``.
19721972
19731973
Parameters
19741974
----------
1975-
clear_pane : bool, optional
1976-
Also clear the visible pane content (``-H`` flag).
1977-
Requires tmux 3.4+.
1975+
reset_hyperlinks : bool, optional
1976+
Also reset hyperlinks (``-H`` flag). Requires tmux 3.4+.
19781977
19791978
.. versionadded:: 0.45
19801979
@@ -1988,12 +1987,12 @@ def clear_history(self, *, clear_pane: bool | None = None) -> None:
19881987

19891988
tmux_args: tuple[str, ...] = ()
19901989

1991-
if clear_pane:
1990+
if reset_hyperlinks:
19921991
if has_gte_version("3.4", tmux_bin=self.server.tmux_bin):
19931992
tmux_args += ("-H",)
19941993
else:
19951994
warnings.warn(
1996-
"clear_pane requires tmux 3.4+, ignoring",
1995+
"reset_hyperlinks requires tmux 3.4+, ignoring",
19971996
stacklevel=2,
19981997
)
19991998

0 commit comments

Comments
 (0)