# session_group_add

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

```c
void session_group_add(struct session_group *sg, struct session *s)
```

## Parameters

- `sg` (`struct session_group *`)
- `s` (`struct session *`)

## Called by

- [`cmd_new_session_exec`](/en/tmux/latest/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#L320)

## Calls

- [`session_group_contains`](/en/tmux/latest/reference/c-function-session_group_contains/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L547)

## Referenced declarations

- [`session`](/en/tmux/latest/reference/c-struct-session/) (struct)
- [`session_group`](/en/tmux/latest/reference/c-struct-session_group/) (struct)
- [`session_group.sessions`](/en/tmux/latest/reference/c-struct-session_group-sessions/) (attribute)
