# LibTmux.Program.waitProgramFor

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

```haskell
waitProgramFor
  :: NominalDiffTime -> Program -> IO (Maybe ProgramExit)
```

Signature types: [`NominalDiffTime`](https://hackage.haskell.org/package/time-1.15/docs/Data-Time-Clock.html#t:NominalDiffTime), [`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), [`Maybe`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Data-Maybe.html#t:Maybe), [`ProgramExit`](/en/haskell/latest/reference/libtmux-program-t-programexit/).

Bound only this observation. Nothing means the deadline elapsed; it does
 not terminate the application. Async cancellation also leaves it running.

## 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 `waitProgramFor`.

- [`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 `waitProgramFor`.

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