# session_set_current

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

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

## Parameters

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

## 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#L96)
- [`cmd_new_window_exec`](/en/tmux/3.7c/reference/c-function-cmd-new-window-c-cmd_new_window_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L103)
- [`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#L150)
- [`session_last`](/en/tmux/3.7c/reference/c-function-session_last/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L471)
- [`session_next`](/en/tmux/3.7c/reference/c-function-session_next/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L415)
- [`session_previous`](/en/tmux/3.7c/reference/c-function-session_previous/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L446)
- [`session_select`](/en/tmux/3.7c/reference/c-function-session_select/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L456)
- [`window_tree_swap`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_swap/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L860)

## Calls

- [`notify_session`](/en/tmux/3.7c/reference/c-function-notify_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L496)
- [`options_get_number`](/en/tmux/3.7c/reference/c-function-options_get_number/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L488)
- [`tty_update_window_offset`](/en/tmux/3.7c/reference/c-function-tty_update_window_offset/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L495)
- [`window_update_activity`](/en/tmux/3.7c/reference/c-function-window_update_activity/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L494)
- [`window_update_focus`](/en/tmux/3.7c/reference/c-function-window_update_focus/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L490)
- [`winlink_clear_flags`](/en/tmux/3.7c/reference/c-function-winlink_clear_flags/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L493)
- [`winlink_stack_push`](/en/tmux/3.7c/reference/c-function-winlink_stack_push/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L486)
- [`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#L485)

## Referenced declarations

- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`global_options`](/en/tmux/3.7c/reference/c-variable-global_options/) (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)
- [`winlink`](/en/tmux/3.7c/reference/c-struct-winlink/) (struct)
