# run_and_wait

Source: https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/

> run_and_wait: Run one shell command in a pane, wait for it to finish, and read its exit status.

**Concept example** A working example of the core library. It can change without notice. [What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **run_and_wait**( [command](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.command), [pane_id](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.pane_id), [timeout](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.timeout)?, )

  prompt

  Run one shell command in a pane, wait for it to finish, and read its exit status.

  * MCP request method

    `prompts/get` Send `run_and_wait` as the prompt name, with the arguments below.

  ## Arguments

  * **[`command`](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.command)**

    the shell command to run

    * Binding

      Prompt argument

  * **[`pane_id`](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.pane_id)**

    the target pane, such as %1

    * Binding

      Prompt argument

  * **[`timeout`](https://libtmux.org/en/go/latest/mcp/prompts/run_and_wait/#mcp.prompt.run_and_wait.parameter.timeout)**?

    seconds to wait for completion; defaults to 60

    * Binding

      Prompt argument

  ## Result

  Returns the prompt’s messages. The client supplies the advertised arguments as strings.

  ## Protocol data

  Use the complete advertised contract for validation and client integration.

  Registration

  ```json
  {
    "_meta": {
      "com.git-pull.libtmux-mcp/prompt": {
        "arguments": [
          {
            "description": "the shell command to run",
            "name": "command",
            "required": true
          },
          {
            "description": "the target pane, such as %1",
            "name": "pane_id",
            "required": true
          },
          {
            "description": "seconds to wait for completion; defaults to 60",
            "name": "timeout",
            "required": false
          }
        ],
        "description": "Run one shell command in a pane, wait for it to finish, and read its exit status.",
        "name": "run_and_wait",
        "requiresTools": [
          "run_shell_command"
        ],
        "title": "Run a command and wait"
      }
    },
    "arguments": [
      {
        "description": "the shell command to run",
        "name": "command",
        "required": true
      },
      {
        "description": "the target pane, such as %1",
        "name": "pane_id",
        "required": true
      },
      {
        "description": "seconds to wait for completion; defaults to 60",
        "name": "timeout"
      }
    ],
    "description": "Run one shell command in a pane, wait for it to finish, and read its exit status.",
    "name": "run_and_wait",
    "title": "Run a command and wait"
  }
  ```

Source revision: [libtmux/libtmux-go@a11c2d5b512261d74a43aa58d41fdc069f343bb8](https://github.com/libtmux/libtmux-go/tree/a11c2d5b512261d74a43aa58d41fdc069f343bb8).
