# LibTmux.open_server

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

```
open_server(; tmux, env, timeout, cancel)
```

## Methods

Start an isolated foreground tmux daemon with an empty configuration and a unique private socket directory. Validate its reported PID against the spawned child before returning an `OwnedServer`. Environment entries are copied and validated; inherited `TMUX` and `TMUX_PANE` are removed. No ambient server is contacted. The temporary directory must permit a socket path under 104 bytes.

```julia
open_server(; tmux="tmux", env=ENV, timeout=0.9, cancel=nothing)
```



`timeout` bounds startup using a monotonic clock; `cancel` applies only until startup finishes. Both failure paths reap the daemon. Daemon stderr retains at most 64 KiB; startup and cleanup errors indicate truncated diagnostics. Close the returned handle explicitly, or use `with_server` for scoped ownership.

## Parameters

- `tmux`
  Default: `"tmux"`.
- `env` (`AbstractDict`)
  Default: `ENV`.
- `timeout` (`Real`)
  Default: `0.9`.
- `cancel` (`Union{Nothing, CancellationToken}`)
  Default: `nothing`.
