# run_shell_command

Source: https://libtmux.org/en/dotnet/latest/mcp/tools/run_shell_command/

> Run a shell command in a pane with your user's permissions. Run a shell command in one pane, wait for it to finish, and report its singular real exit status and output. This is the tool for 'run X and tell me if it worked'. It reaches only the pane you name: the command travels through a tmux buffer, which synchronize-panes does not fan out, so the exit status is one pane's. Use send_keys when you want a synchronized cohort to receive input. Do NOT send keys and then poll a capture in a loop — this waits deterministically and costs one call. The command runs in a subshell, so cd and export do not persist. It refuses the named pane in a human-owned mode. Check linesMissed and anchorLost. A timed-out command MAY STILL BE RUNNING; inspect it and do not retry it — unless started is false, which means it never ran because something other than an idle shell was reading that pane's input.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Run a shell command in a pane with your user’s permissions. Run a shell command in one pane, wait for it to finish, and report its singular real exit status and output. This is the tool for ‘run X and tell me if it worked’. It reaches only the pane you name: the command travels through a tmux buffer, which synchronize-panes does not fan out, so the exit status is one pane’s. Use [send\_keys](https://libtmux.org/en/dotnet/latest/mcp/tools/send_keys/) when you want a synchronized cohort to receive input. Do NOT send keys and then poll a capture in a loop — this waits deterministically and costs one call. The command runs in a subshell, so cd and export do not persist. It refuses the named pane in a human-owned mode. Check linesMissed and anchorLost. A timed-out command MAY STILL BE RUNNING; inspect it and do not retry it — unless started is false, which means it never ran because something other than an idle shell was reading that pane’s input.

[All .NET tools](../) · [JSON](../run_shell_command.json) · [Source](https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux.Mcp/Policy/CapabilityModel.cs#L596)

## Arguments

* `command` required · string

  The shell command.

* `maxLines` optional · integer | null

  Maximum returned lines.

  Default: `null`.

* `paneId` optional · string | null

  A pane id. Omit for the active pane.

  Default: `null`.

* `suppressHistory` optional · boolean

  Keep the command out of shell history on a best-effort basis.

  Default: `false`.

* `timeoutSeconds` optional · number | null

  Requested timeout in seconds.

  Default: `null`.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.
