Skip to content

Commit efb7bcb

Browse files
committed
mcp(docs[copy_mode]): note pane.cmd injects -t pane_id
Inline comments at both ``pane.cmd`` sites in ``copy_mode.py`` so a future contributor doesn't "fix" the missing ``-t pane.pane_id`` back in. ``libtmux.Pane.cmd`` injects ``-t self.pane_id`` already; the manual prefix produced ``tmux <verb> -t %X -t %X ...`` and tmux's argparser silently kept the last ``-t``. The CHANGES file documents the original cleanup; this lifts the explanation onto the line that needs it.
1 parent cafb64f commit efb7bcb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/libtmux_mcp/tools/pane_tools/copy_mode.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def enter_copy_mode(
5555
session_id=session_id,
5656
window_id=window_id,
5757
)
58+
# libtmux's Pane.cmd injects ``-t pane.pane_id``; passing it again
59+
# produced the duplicated ``-t %X -t %X`` shape tmux silently accepted.
5860
pane.cmd("copy-mode")
5961
if scroll_up is not None and scroll_up > 0:
6062
pane.cmd(
@@ -107,6 +109,7 @@ def exit_copy_mode(
107109
session_id=session_id,
108110
window_id=window_id,
109111
)
112+
# See enter_copy_mode: Pane.cmd injects ``-t pane.pane_id`` already.
110113
pane.cmd("send-keys", "-X", "cancel")
111114
pane.refresh()
112115
return _serialize_pane(pane)

0 commit comments

Comments
 (0)