# Server.detach(_:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Navigation.swift#L222
- **Page:** https://libtmux.org/reference/swift/server-detach(_-)/

```
Server.detach(_:)(client: Client) -> ()
```

Detaches a client from the server it is attached to.

A server operation despite the name: it acts on a client the server
already holds, so it needs no terminal of its own. The session the
client was viewing is untouched. The daemon incarnation is guarded,
but tmux cannot atomically compare `client_pid`; this detaches whichever
current client has ``Client/name``.

## Raises

- `TmuxError`
