# server_link_window

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L248
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-server_link_window/

```c
int server_link_window(struct session *src, struct winlink *srcwl, struct session *dst, int dstidx, int killflag, int selectflag, char **cause)
```

## Parameters

- `src` (`struct session *`)
- `srcwl` (`struct winlink *`)
- `dst` (`struct session *`)
- `dstidx` (`int`)
- `killflag` (`int`)
- `selectflag` (`int`)
- `cause` (`char **`)

## Called by

- [`cmd_break_pane_exec`](/en/tmux/latest/reference/c-function-cmd-break-pane-c-cmd_break_pane_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-break-pane.c#L82)
- [`cmd_move_window_exec`](/en/tmux/latest/reference/c-function-cmd-move-window-c-cmd_move_window_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-move-window.c#L103)

## Calls

- [`notify_session_window`](/en/tmux/latest/reference/c-function-notify_session_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L275)
- [`server_redraw_session_group`](/en/tmux/latest/reference/c-function-server_redraw_session_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L299)
- [`session_attach`](/en/tmux/latest/reference/c-function-session_attach/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L291)
- [`session_group_contains`](/en/tmux/latest/reference/c-function-session_group_contains/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L255)
- [`session_select`](/en/tmux/latest/reference/c-function-session_select/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L298)
- [`winlink_find_by_index`](/en/tmux/latest/reference/c-function-winlink_find_by_index/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L264)
- [`winlink_remove`](/en/tmux/latest/reference/c-function-winlink_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L279)
- [`winlink_stack_remove`](/en/tmux/latest/reference/c-function-winlink_stack_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L278)
- [`xasprintf`](/en/tmux/latest/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L258)

## Other function references

- [`options_get_number`](/en/tmux/latest/reference/c-function-options_get_number/) (function)

## Referenced by

- [`server_client_detach`](/en/tmux/latest/reference/c-function-server_client_detach/) (function)

## Referenced declarations

- [`session.curw`](/en/tmux/latest/reference/c-struct-session-curw/) (attribute)
- [`winlink.flags`](/en/tmux/latest/reference/c-struct-winlink-flags/) (attribute)
- [`winlink.idx`](/en/tmux/latest/reference/c-struct-winlink-idx/) (attribute)
- [`session.lastw`](/en/tmux/latest/reference/c-struct-session-lastw/) (attribute)
- [`marked_pane`](/en/tmux/latest/reference/c-variable-marked_pane/) (attribute)
- [`session.options`](/en/tmux/latest/reference/c-struct-session-options/) (attribute)
- [`session`](/en/tmux/latest/reference/c-struct-session/) (struct)
- [`winlink.window`](/en/tmux/latest/reference/c-struct-winlink-window/) (attribute)
- [`session.windows`](/en/tmux/latest/reference/c-struct-session-windows/) (attribute)
- [`winlink`](/en/tmux/latest/reference/c-struct-winlink/) (struct)
- [`WINLINK_ALERTFLAGS`](/en/tmux/latest/reference/c-define-tmux-h-winlink_alertflags/) (constant)
- [`cmd_find_state.wl`](/en/tmux/latest/reference/c-struct-cmd_find_state-wl/) (attribute)
