# window_client_do_detach

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L340
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-window-client-c-window_client_do_detach/

```c
static void window_client_do_detach(void *modedata, void *itemdata, struct client *c, key_code key)
```

## Parameters

- `modedata` (`void *`)
- `itemdata` (`void *`)
- `c` (`struct client *`)
- `key` (`key_code`)

## Called by

- [`window_client_key`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L373)

## Calls

- [`mode_tree_down`](/en/tmux/3.7c/reference/c-function-mode_tree_down/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L347)
- [`server_client_detach`](/en/tmux/3.7c/reference/c-function-server_client_detach/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L349)
- [`server_client_suspend`](/en/tmux/3.7c/reference/c-function-server_client_suspend/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L353)

## Other function references

- [`mode_tree_get_current`](/en/tmux/3.7c/reference/c-function-mode_tree_get_current/) (function)

## Referenced declarations

- [`__unused`](/en/tmux/3.7c/reference/c-define-compat-h-__unused/) (constant)
- [`window_client_itemdata.c`](/en/tmux/3.7c/reference/c-struct-window_client_itemdata-c/) (attribute)
- [`client`](/en/tmux/3.7c/reference/c-struct-client/) (struct)
- [`window_client_modedata.data`](/en/tmux/3.7c/reference/c-struct-window_client_modedata-data/) (attribute)
- [`key_code`](/en/tmux/3.7c/reference/c-typedef-key_code/) (typealias)
- [`MSG_DETACH`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_detach/) (constant)
- [`MSG_DETACHKILL`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_detachkill/) (constant)
