# LibTmux.Program.run/4

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/program.ex#L141
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-program-run-4/

```
run(server, target, argv, options \\ [])
@spec run(
        LibTmux.Server.t(),
        LibTmux.Ref.t(),
        [binary(), ...],
        [
          option() | {:cleanup_timeout, 1..600_000}
        ]
      ) ::
        {:ok, result()} | {:error, LibTmux.Action.error()}
```

Starts an owned application, waits for its result and removes its pane.

The timeout covers startup, the application wait and final screen capture.
The optional cleanup budget defaults to 2,000 ms and covers cancellation,
verified application retirement and pane removal. A timed-out run keeps
its primary error and includes the cleanup result in its details. If
cleanup is incomplete, the error also retains the accepted handle.

## Parameters

- `server` (`LibTmux.Server.t()`)
- `target` (`LibTmux.Ref.t()`)
- `argv` (`[binary(), ...]`)
- `options` (`[option() | {:cleanup_timeout, 1..600_000}]`)
  Default: `[]`.
