# server_client_detach

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-client.c#L431
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-server_client_detach/

```c
void server_client_detach(struct client *c, enum msgtype msgtype)
```

## Parameters

- `c` (`struct client *`)
- `msgtype` (`enum msgtype`)

## Called by

- [`cmd_attach_session`](/en/tmux/3.2a/reference/c-function-cmd_attach_session/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-attach-session.c#L121)
- [`cmd_detach_client_exec`](/en/tmux/3.2a/reference/c-function-cmd-detach-client-c-cmd_detach_client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-detach-client.c#L86)
- [`window_client_do_detach`](/en/tmux/3.2a/reference/c-function-window-client-c-window_client_do_detach/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-client.c#L373)

## Calls

- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-client.c#L442)

## Other function references

- [`server_client_exec`](/en/tmux/3.2a/reference/c-function-server_client_exec/) (function)
- [`server_client_loop`](/en/tmux/3.2a/reference/c-function-server_client_loop/) (function)

## Referenced declarations

- [`client`](/en/tmux/3.2a/reference/c-struct-client/) (struct)
- [`CLIENT_EXIT`](/en/tmux/3.2a/reference/c-define-tmux-h-client_exit/) (constant)
- [`CLIENT_UNATTACHEDFLAGS`](/en/tmux/3.2a/reference/c-define-tmux-h-client_unattachedflags/) (constant)
- [`client.exit_msgtype`](/en/tmux/3.2a/reference/c-struct-client-exit_msgtype/) (attribute)
- [`client.exit_session`](/en/tmux/3.2a/reference/c-struct-client-exit_session/) (attribute)
- [`client.exit_type`](/en/tmux/3.2a/reference/c-struct-client-exit_type/) (attribute)
- [`client.flags`](/en/tmux/3.2a/reference/c-struct-client-flags/) (attribute)
- [`msgtype`](/en/tmux/3.2a/reference/c-enum-msgtype/) (enum)
- [`session.name`](/en/tmux/3.2a/reference/c-struct-session-name/) (attribute)
- [`client.session`](/en/tmux/3.2a/reference/c-struct-client-session/) (attribute)
