Skip to content

Commit 512552b

Browse files
committed
Server(fix[run_shell]): -C means tmux command, not capture output
why: run-shell -C parses the argument as a tmux command instead of a shell command (ARGS_PARSE_COMMANDS_OR_STRING). It does not capture output. Verified in cmd-run-shell.c:50. what: - Rename capture param to as_tmux_command - Update docstring to reflect actual semantics
1 parent 265b9eb commit 512552b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/libtmux/server.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def run_shell(
429429
*,
430430
background: bool | None = None,
431431
delay: str | None = None,
432-
capture: bool | None = None,
432+
as_tmux_command: bool | None = None,
433433
target_pane: str | None = None,
434434
) -> list[str] | None:
435435
"""Execute a shell command via ``$ tmux run-shell``.
@@ -442,8 +442,9 @@ def run_shell(
442442
Run in background (``-b`` flag).
443443
delay : str, optional
444444
Delay before execution (``-d`` flag).
445-
capture : bool, optional
446-
Capture output to the target pane (``-C`` flag).
445+
as_tmux_command : bool, optional
446+
Parse argument as a tmux command instead of a shell command
447+
(``-C`` flag).
447448
target_pane : str, optional
448449
Target pane for output (``-t`` flag).
449450
@@ -466,7 +467,7 @@ def run_shell(
466467
if delay is not None:
467468
tmux_args += ("-d", delay)
468469

469-
if capture:
470+
if as_tmux_command:
470471
tmux_args += ("-C",)
471472

472473
if target_pane is not None:

0 commit comments

Comments
 (0)