# LibTmux.Program.close/2

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

```
close(program, timeout)
@spec close(t() | startup(), 1..600_000) ::
        {:ok,
         result()
         | %{
             pane_cleanup: :removed,
             application: :unproved
           }}
        | {:error, LibTmux.Error.t()}
```

Cancels or joins the application and removes the accepted pane.

This operation consumes the handle after removal. A replacement pane is
left in place. If removal cannot be proved, the error keeps the observed
application result and the handle for recovery. Pass the startup handle
in a failed start's details to retry removal without inferring an exit.

## Parameters

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