# LibTmux.Program.terminateProgram

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/72edb54317bf619c6dc54bff311844f062f8984c/internal/LibTmux/Internal/Program.hs#L631
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-program-v-terminateprogram/

```haskell
terminateProgram :: Program -> IO ProgramExit
```

Signature types: [`Program`](/en/haskell/latest/reference/libtmux-program-t-program/), [`IO`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:IO), [`ProgramExit`](/en/haskell/latest/reference/libtmux-program-t-programexit/).

Request TERM, wait up to 100ms for leader exit, then send KILL to the retained
 process-group identity. Descendants that move to another group/session are
 outside this ownership contract. The returned outcome belongs to the leader.

## Referenced declarations

- [`LibTmux.Program.Program`](/en/haskell/latest/reference/libtmux-program-t-program/) (data type)
- [`LibTmux.Program.ProgramExit`](/en/haskell/latest/reference/libtmux-program-t-programexit/) (data type)

## tmux command

The tmux commands behind `terminateProgram`.

- [`display-message`](/en/tmux/latest/manual/display-message/) (when the outcome is not already cached)
- [`wait-for`](/en/tmux/latest/manual/wait-for/) (when the outcome is not already cached)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
- [`cmd_wait_for_entry`](/en/tmux/latest/reference/c-variable-cmd_wait_for_entry/) (attribute)
- [`cmd_wait_for_exec`](/en/tmux/latest/reference/c-function-cmd-wait-for-c-cmd_wait_for_exec/) (function)

## Guides

Pages that discuss `terminateProgram`.

- [Run terminal applications](/en/haskell/latest/guides/programs/)
