# cmd_find_best_session_with_window

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L176
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_best_session_with_window/

```c
static int cmd_find_best_session_with_window(struct cmd_find_state *)
```

## Parameters

- `fs` (`struct cmd_find_state *`)

## Called by

- [`cmd_find_current_client`](/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_current_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1274)
- [`cmd_find_from_client`](/en/tmux/latest/reference/c-function-cmd_find_from_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L898)
- [`cmd_find_from_window`](/en/tmux/latest/reference/c-function-cmd_find_from_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L775)
- [`cmd_find_get_pane`](/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_get_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L510)
- [`cmd_find_get_window`](/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_get_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L321)

## Calls

- [`cmd_find_best_session`](/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_best_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L193)
- [`cmd_find_best_winlink_with_window`](/en/tmux/latest/reference/c-function-cmd-find-c-cmd_find_best_winlink_with_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L197)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L182)
- [`session_has`](/en/tmux/latest/reference/c-function-session_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L186)
- [`xreallocarray`](/en/tmux/latest/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L188)

## Referenced declarations

- [`cmd_find_state`](/en/tmux/latest/reference/c-struct-cmd_find_state/) (struct)
- [`cmd_find_state.flags`](/en/tmux/latest/reference/c-struct-cmd_find_state-flags/) (attribute)
- [`window.id`](/en/tmux/latest/reference/c-struct-window-id/) (attribute)
- [`cmd_find_state.s`](/en/tmux/latest/reference/c-struct-cmd_find_state-s/) (attribute)
- [`cmd_find_state.w`](/en/tmux/latest/reference/c-struct-cmd_find_state-w/) (attribute)
