# session_create

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

```c
struct session * session_create(const char *prefix, const char *name, const char *cwd, struct environ *env, struct options *oo, struct termios *tio)
```

## Parameters

- `prefix` (`const char *`)
- `name` (`const char *`)
- `cwd` (`const char *`)
- `env` (`struct environ *`)
- `oo` (`struct options *`)
- `tio` (`struct termios *`)

## Called by

- [`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#L289)

## Calls

- [`fatal`](/en/tmux/3.7c/reference/c-function-fatal/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L153)
- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L150)
- [`session_update_activity`](/en/tmux/3.7c/reference/c-function-session_update_activity/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L154)
- [`status_update_cache`](/en/tmux/3.7c/reference/c-function-status_update_cache/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L127)
- [`xasprintf`](/en/tmux/3.7c/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L143)
- [`xcalloc`](/en/tmux/3.7c/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L116)
- [`xmalloc`](/en/tmux/3.7c/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L131)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L119)

## Referenced declarations

- [`session.creation_time`](/en/tmux/3.7c/reference/c-struct-session-creation_time/) (attribute)
- [`session.cwd`](/en/tmux/3.7c/reference/c-struct-session-cwd/) (attribute)
- [`environ`](/en/tmux/3.7c/reference/c-struct-environ/) (struct)
- [`session.environ`](/en/tmux/3.7c/reference/c-struct-session-environ/) (attribute)
- [`session.flags`](/en/tmux/3.7c/reference/c-struct-session-flags/) (attribute)
- [`session.id`](/en/tmux/3.7c/reference/c-struct-session-id/) (attribute)
- [`session.lastw`](/en/tmux/3.7c/reference/c-struct-session-lastw/) (attribute)
- [`session.name`](/en/tmux/3.7c/reference/c-struct-session-name/) (attribute)
- [`next_session_id`](/en/tmux/3.7c/reference/c-variable-next_session_id/) (attribute)
- [`options`](/en/tmux/3.7c/reference/c-struct-options/) (struct)
- [`session.options`](/en/tmux/3.7c/reference/c-struct-session-options/) (attribute)
- [`session.references`](/en/tmux/3.7c/reference/c-struct-session-references/) (attribute)
- [`session`](/en/tmux/3.7c/reference/c-struct-session/) (struct)
- [`session.tio`](/en/tmux/3.7c/reference/c-struct-session-tio/) (attribute)
- [`session.windows`](/en/tmux/3.7c/reference/c-struct-session-windows/) (attribute)
