# libtmux:detach-client

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/client-operations.lisp#L65
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-detach-client/

```
(detach-client client target &key cancel-token timeout output-limit)
```

Request detachment of captured terminal TARGET; return a COMMAND-OUTCOME.
CLIENT must own the observation. Success acknowledges the server's request,
not frontend process exit or terminal restoration. Returns no replacement.
Blocks under the supplied limits. The unique name/PID/creation/tty preflight
cannot exclude replacement between validation and dispatch. Missing or foreign
targets signal STALE-TARGET; external failures retain their outcome. Never
retries, detaches other clients, kills a parent, or starts a shell command.

See also: `libtmux:fetch-clients`, `libtmux:outcome-status`, `libtmux:switch-client`.

## Parameters

- `client`
- `target`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `detach-client`.

- [`detach-client`](/en/tmux/latest/manual/detach-client/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_detach_client_entry`](/en/tmux/latest/reference/c-variable-cmd_detach_client_entry/) (attribute)
- [`cmd_detach_client_exec`](/en/tmux/latest/reference/c-function-cmd-detach-client-c-cmd_detach_client_exec/) (function)

## Guides

Pages that discuss `detach-client`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
