# server_client_set_session

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

```c
void server_client_set_session(struct client *c, struct session *s)
```

## Parameters

- `c` (`struct client *`)
- `s` (`struct session *`)

## Called by

- [`cmd_attach_session`](/en/tmux/3.7c/reference/c-function-cmd_attach_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-attach-session.c#L137)
- [`cmd_new_session_exec`](/en/tmux/3.7c/reference/c-function-cmd-new-session-c-cmd_new_session_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-session.c#L342)
- [`cmd_switch_client_exec`](/en/tmux/3.7c/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L158)
- [`server_client_dispatch`](/en/tmux/3.7c/reference/c-function-server-client-c-server_client_dispatch/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L2263)
- [`server_destroy_session`](/en/tmux/3.7c/reference/c-function-server_destroy_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L473)

## Calls

- [`alerts_check_session`](/en/tmux/3.7c/reference/c-function-alerts_check_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L422)
- [`notify_client`](/en/tmux/3.7c/reference/c-function-notify_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L425)
- [`recalculate_sizes`](/en/tmux/3.7c/reference/c-function-recalculate_sizes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L416)
- [`server_check_unattached`](/en/tmux/3.7c/reference/c-function-server_check_unattached/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L429)
- [`server_redraw_client`](/en/tmux/3.7c/reference/c-function-server_redraw_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L426)
- [`server_update_socket`](/en/tmux/3.7c/reference/c-function-server_update_socket/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L430)
- [`session_theme_changed`](/en/tmux/3.7c/reference/c-function-session_theme_changed/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L419)
- [`session_update_activity`](/en/tmux/3.7c/reference/c-function-session_update_activity/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L418)
- [`status_timer_start`](/en/tmux/3.7c/reference/c-function-status_timer_start/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L424)
- [`tty_update_client_offset`](/en/tmux/3.7c/reference/c-function-tty_update_client_offset/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L423)
- [`window_update_focus`](/en/tmux/3.7c/reference/c-function-window_update_focus/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L413)

## Referenced declarations

- [`client`](/en/tmux/3.7c/reference/c-struct-client/) (struct)
- [`CLIENT_FOCUSED`](/en/tmux/3.7c/reference/c-define-tmux-h-client_focused/) (constant)
- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`client.flags`](/en/tmux/3.7c/reference/c-struct-client-flags/) (attribute)
- [`winlink.flags`](/en/tmux/3.7c/reference/c-struct-winlink-flags/) (attribute)
- [`session.last_attached_time`](/en/tmux/3.7c/reference/c-struct-session-last_attached_time/) (attribute)
- [`client.last_session`](/en/tmux/3.7c/reference/c-struct-client-last_session/) (attribute)
- [`window.latest`](/en/tmux/3.7c/reference/c-struct-window-latest/) (attribute)
- [`client.session`](/en/tmux/3.7c/reference/c-struct-client-session/) (attribute)
- [`session`](/en/tmux/3.7c/reference/c-struct-session/) (struct)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`WINLINK_ALERTFLAGS`](/en/tmux/3.7c/reference/c-define-tmux-h-winlink_alertflags/) (constant)
