# LibTmux.FSharp.Control

- **Module:** LibTmux.FSharp
- **Package:** LibTmux.FSharp
- **Language:** F#
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.FSharp/Control.fsi#L24
- **Page:** https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-control/

```
module Control
```

Opens control clients and reads their event streams.

Streams are cold: nothing is read until a consumer enumerates one, and the
consumer supplies the cancellation token. Any <c>IAsyncEnumerable</c>
library composes them, including FSharp.Control.TaskSeq.

## Members

### Common operations

- `withSession` (function): Opens a control client, runs work, and disposes the client after the returned task completes.
- `events` (function): Streams every event a control client reports.
- `watchPane` (function): Streams one pane's output from a borrowed control client.
- `watchPanes` (function): Streams several panes' output from one borrowed control client.
- `cleanupFailure` (function): Returns the cleanup failure attached to the exception a helper rethrew.
- `enter` (function): Opens a control client attached to the most recently used session.
- `enterSession` (function): Opens a control client attached to a session.
- `foldWhile` (function): Folds items until the stream ends or the folder returns Stop.
- `iter` (function): Awaits one handler at a time for each item until the stream ends.
- `useSession` (function): Runs work with an owned control client and disposes it after the returned task completes.
