# LibTmux.open_control

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control.jl#L1069
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-open_control/

```
open_control(f, server::LibTmux.Server, session::LibTmux.SessionRef; kwargs...)

open_control(
    server::LibTmux.Server,
    session::LibTmux.SessionRef;
    timeout,
    cancel,
    capacity
)
```

## Methods

### `open_control(f, server::LibTmux.Server, session::LibTmux.SessionRef; kwargs...)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control.jl#L1122).

### `open_control` (overload 2)

```julia
open_control(
    server::LibTmux.Server,
    session::LibTmux.SessionRef;
    timeout,
    cancel,
    capacity
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control.jl#L1087).

Open two owned control clients on the borrowed session: a request lane and a cleanup lane for library-owned waits. Both independently verify the captured generation over their own connection. The two attachments are observable; configured attach/detach hooks and unattached-session/server policies apply.

```julia
open_control(server, session::SessionRef; timeout=5.0, cancel=nothing, capacity=64)
```



Capacity includes minted signals until cleanup. `close` stops admission, signals submitted owned waits, waits for their fences, then joins both client processes and all I/O/cleanup tasks. A dead/unresponsive backend can prevent proving remote retirement; local cleanup remains bounded and effects are reported by `ControlCleanupError`; `ControlSignal.cleanup_done` remains false without its primary completion fence. No borrowed wait channel is signalled. The do-block form preserves body and cleanup failures in `CompositeException`. `capacity` must be positive, fit `Int`, and cannot be `Bool`; invalid capacity fails before attaching a client.

## Parameters

- `f` (`Any`) (for `open_control(f, server, session, kwargs)`)
- `server` (`LibTmux.Server`)
- `session` (`LibTmux.SessionRef`)
- `kwargs` (for `open_control(f, server, session, kwargs)`)
- `timeout` (`Real`) (for `open_control(server, session, timeout, cancel, capacity)`)
  Default: `5.0`.
- `cancel` (for `open_control(server, session, timeout, cancel, capacity)`)
  Default: `nothing`.
- `capacity` (`Integer`) (for `open_control(server, session, timeout, cancel, capacity)`)
  Default: `64`.
