# session_detach

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L341
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-session_detach/

```c
int session_detach(struct session *s, struct winlink *wl)
```

## Parameters

- `s` (`struct session *`)
- `wl` (`struct winlink *`)

## Called by

- [`server_kill_window`](/en/tmux/3.7c/reference/c-function-server_kill_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L211)
- [`server_unlink_window`](/en/tmux/3.7c/reference/c-function-server_unlink_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L307)

## Calls

- [`notify_session_window`](/en/tmux/3.7c/reference/c-function-notify_session_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L349)
- [`session_group_synchronize_from`](/en/tmux/3.7c/reference/c-function-session_group_synchronize_from/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L353)
- [`session_next`](/en/tmux/3.7c/reference/c-function-session_next/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L346)
- [`winlink_remove`](/en/tmux/3.7c/reference/c-function-winlink_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L351)
- [`winlink_stack_remove`](/en/tmux/3.7c/reference/c-function-winlink_stack_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L350)

## Other function references

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

## Referenced declarations

- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`winlink.flags`](/en/tmux/3.7c/reference/c-struct-winlink-flags/) (attribute)
- [`session.lastw`](/en/tmux/3.7c/reference/c-struct-session-lastw/) (attribute)
- [`session`](/en/tmux/3.7c/reference/c-struct-session/) (struct)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`session.windows`](/en/tmux/3.7c/reference/c-struct-session-windows/) (attribute)
- [`winlink`](/en/tmux/3.7c/reference/c-struct-winlink/) (struct)
- [`WINLINK_ALERTFLAGS`](/en/tmux/3.7c/reference/c-define-tmux-h-winlink_alertflags/) (constant)
