# window_tree_build_session

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L305
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-window-tree-c-window_tree_build_session/

```c
static void window_tree_build_session(struct session *s, void *modedata, struct sort_criteria *sort_crit, const char *filter)
```

## Parameters

- `s` (`struct session *`)
- `modedata` (`void *`)
- `sort_crit` (`struct sort_criteria *`)
- `filter` (`const char *`)

## Called by

- [`window_tree_build`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_build/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L378)

## Calls

- [`format_defaults`](/en/tmux/latest/reference/c-function-format_defaults/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L324)
- [`format_expand`](/en/tmux/latest/reference/c-function-format_expand/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L325)
- [`format_free`](/en/tmux/latest/reference/c-function-format_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L326)
- [`mode_tree_add`](/en/tmux/latest/reference/c-function-mode_tree_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L332)
- [`mode_tree_remove`](/en/tmux/latest/reference/c-function-mode_tree_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L346)
- [`sort_get_winlinks_session`](/en/tmux/latest/reference/c-function-sort_get_winlinks_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L336)
- [`window_tree_add_item`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_add_item/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L317)
- [`window_tree_build_window`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_build_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L339)
- [`window_tree_free_item`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_free_item/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L344)

## Other function references

- [`format_create`](/en/tmux/latest/reference/c-function-format_create/) (function)

## Referenced declarations

- [`window.active`](/en/tmux/latest/reference/c-struct-window-active/) (attribute)
- [`session.curw`](/en/tmux/latest/reference/c-struct-session-curw/) (attribute)
- [`window_tree_modedata.data`](/en/tmux/latest/reference/c-struct-window_tree_modedata-data/) (attribute)
- [`window_tree_modedata.format`](/en/tmux/latest/reference/c-struct-window_tree_modedata-format/) (attribute)
- [`FORMAT_PANE`](/en/tmux/latest/reference/c-define-tmux-h-format_pane/) (constant)
- [`session.id`](/en/tmux/latest/reference/c-struct-session-id/) (attribute)
- [`window_pane.id`](/en/tmux/latest/reference/c-struct-window_pane-id/) (attribute)
- [`format_tree.item`](/en/tmux/latest/reference/c-struct-format_tree-item/) (attribute)
- [`window_tree_modedata.item_size`](/en/tmux/latest/reference/c-struct-window_tree_modedata-item_size/) (attribute)
- [`session.name`](/en/tmux/latest/reference/c-struct-session-name/) (attribute)
- [`format_tree.s`](/en/tmux/latest/reference/c-struct-format_tree-s/) (attribute)
- [`session`](/en/tmux/latest/reference/c-struct-session/) (struct)
- [`sort_criteria`](/en/tmux/latest/reference/c-struct-sort_criteria/) (struct)
- [`mode_tree_item.text`](/en/tmux/latest/reference/c-struct-mode_tree_item-text/) (attribute)
- [`cmdq_item.type`](/en/tmux/latest/reference/c-struct-cmdq_item-type/) (attribute)
- [`window_tree_modedata.type`](/en/tmux/latest/reference/c-struct-window_tree_modedata-type/) (attribute)
- [`winlink.window`](/en/tmux/latest/reference/c-struct-winlink-window/) (attribute)
- [`WINDOW_TREE_SESSION`](/en/tmux/latest/reference/c-enum-window_tree_type-window_tree_session/) (constant)
- [`format_tree.wl`](/en/tmux/latest/reference/c-struct-format_tree-wl/) (attribute)
