# cmd_find_best_session

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-find.c#L152
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-find-c-cmd_find_best_session/

```c
static struct session * cmd_find_best_session(struct session **, u_int, int)
```

## Parameters

- `slist` (`struct session **`)
- `ssize` (`u_int`)
- `flags` (`int`)

## Called by

- [`cmd_find_best_session_with_window`](/en/tmux/3.2a/reference/c-function-cmd-find-c-cmd_find_best_session_with_window/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-find.c#L193)
- [`cmd_find_from_nothing`](/en/tmux/3.2a/reference/c-function-cmd_find_from_nothing/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-find.c#L823)

## Calls

- [`cmd_find_session_better`](/en/tmux/3.2a/reference/c-function-cmd-find-c-cmd_find_session_better/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-find.c#L162)
- [`log_debug`](/en/tmux/3.2a/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-find.c#L157)

## Referenced by

- [`cmd_find_current_client`](/en/tmux/3.2a/reference/c-function-cmd-find-c-cmd_find_current_client/) (function)

## Referenced declarations

- [`session.flags`](/en/tmux/3.2a/reference/c-struct-session-flags/) (attribute)
- [`session`](/en/tmux/3.2a/reference/c-struct-session/) (struct)
