# cmd_find_session_better

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

```c
static int cmd_find_session_better(struct session *, struct session *, int)
```

## Parameters

- `s` (`struct session *`)
- `than` (`struct session *`)
- `flags` (`int`)

## Called by

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

## Referenced declarations

- [`session.activity_time`](/en/tmux/3.2a/reference/c-struct-session-activity_time/) (attribute)
- [`session.attached`](/en/tmux/3.2a/reference/c-struct-session-attached/) (attribute)
- [`CMD_FIND_PREFER_UNATTACHED`](/en/tmux/3.2a/reference/c-define-tmux-h-cmd_find_prefer_unattached/) (constant)
- [`client.flags`](/en/tmux/3.2a/reference/c-struct-client-flags/) (attribute)
- [`session`](/en/tmux/3.2a/reference/c-struct-session/) (struct)
- [`timercmp`](/en/tmux/3.2a/reference/c-define-compat-h-timercmp/) (constant)
