# tmux_server:close/1

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_server.erl#L267
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_server-close-1/

```
close(Server)
-spec close(t()) -> ok | {error, map()}.
```

Retire this endpoint's operations and one-shot clients, preserving the borrowed tmux server. Returns ok only after their cleanup completes; incomplete cleanup remains an explicit error. Closing an already closed retained handle is idempotent. The initiator controls endpoint lifetime. Separate control attachments are invalidated and asked to retire; use `tmux_control:close/1` before this call to verify those clients' cleanup too.

## Parameters

- `Server` (`t()`)

## Guides

Pages that discuss `close/1`.

### Guides

- [Pipe pane output](/en/erlang/latest/guides/piping/)

### Topics

- [Ownership and identity](/en/erlang/latest/topics/ownership/)
