# LibTmux.Program.cancel/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/ce52194a746ce1d6785c352a731cff734e0d11ce/lib/libtmux/program.ex#L273
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-program-cancel-2/

```
cancel(program, timeout)
@spec cancel(t(), 1..600_000) ::
        {:ok, result()} | {:error, LibTmux.Error.t()}
```

Requests termination through the private launcher, then waits for retirement.

A natural exit can win the race with cancellation. The result retains the
actual exit evidence in either case. A timeout can occur after a
termination request has reached the launcher. Await the same handle
for its result or retry cancellation within a new caller budget.

## Parameters

- `program` (`t()`)
- `timeout` (`1..600_000`)
