# session_last

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

```c
int session_last(struct session *s)
```

## Parameters

- `s` (`struct session *`)

## Called by

- [`cmd_select_window_exec`](/en/tmux/latest/reference/c-function-cmd-select-window-c-cmd_select_window_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-select-window.c#L118)

## Calls

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

## Referenced by

- [`session_detach`](/en/tmux/latest/reference/c-function-session_detach/) (function)
- [`session_group_synchronize1`](/en/tmux/latest/reference/c-function-session-c-session_group_synchronize1/) (function)

## Referenced declarations

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