# Libtmux_unix

- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L1
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix/

```ocaml
module Libtmux_unix
```

Blocking Linux tmux clients with explicit scoped cancellation.

Client methods perform I/O unless documented otherwise. Captured [`Libtmux.Snapshot`](/en/ocaml/latest/reference/libtmux-snapshot/) observations and retained [`Operation.inspect`](/en/ocaml/latest/reference/libtmux_unix-operation-inspect/) remain local. Clients belong to the connecting domain. Closure releases their owned resources; tmux applies its configured daemon lifetime.

See [`Client`](/en/ocaml/latest/reference/libtmux_unix-client/) for acquisition and commands, [`Operation`](/en/ocaml/latest/reference/libtmux_unix-operation/) for cancellation outcomes, and [`Subscription`](/en/ocaml/latest/reference/libtmux_unix-subscription/) for bounded future output. The [control guide](https://github.com/libtmux/libtmux-ocaml/blob/master/docs/control.md) explains binding, completion and recovery.

## Members

### Common operations

- [`Cancellation`](/en/ocaml/latest/reference/libtmux_unix-cancellation/) (module)
- [`Client`](/en/ocaml/latest/reference/libtmux_unix-client/) (module): An explicit generation-bound connection. Applications retain ownership of the endpoint choice and resource lifetime.
- [`Workspace`](/en/ocaml/latest/workspace/reference/libtmux_unix-workspace/) (module): Apply validated plans with blocking I/O and scoped cancellation tokens. Execution handles retain journals and borrow existing clients; bootstrap handles own their newly bound clients without owning the daemon.

### Other members

- [`Cleanup`](/en/ocaml/latest/reference/libtmux_unix-cleanup/) (module): Retained failures from releasing processes and descriptors. Reports belong to their creating domain and remain readable after client closure. They preserve secondary failures without replacing a primary exception or cancellation.
- [`Operation`](/en/ocaml/latest/reference/libtmux_unix-operation/) (module): Retained outcomes remain inspectable after client closure, on the owning domain. Keep the handle from {!Client.submit} before {!Client.await}, then read {!Operation.inspect}. The [hook recovery walkthrough](https://github.com/libtmux/libtmux-ocaml/blob/master/docs/hook-recovery.md) shows creation evidence after a later hook failure.
- [`Rendered`](/en/ocaml/latest/reference/libtmux_unix-rendered/) (module): Blocking native Linux transport. No Eio scheduler is started.
- [`Subscription`](/en/ocaml/latest/reference/libtmux_unix-subscription/) (module): Bounded future-byte observation with Data/Gap/End and local cursors. Polling is local; waiting and admission belong to the backend.
- [`Terminal`](/en/ocaml/latest/reference/libtmux_unix-terminal/) (module): Interactive attachment using borrowed application streams. This utility addresses the current daemon explicitly and does not reuse captured targets.
