# grid_collect_history

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/grid.c#L385
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-grid_collect_history/

```c
void grid_collect_history(struct grid *gd, int all)
```

## Parameters

- `gd` (`struct grid *`)
- `all` (`int`)

## Called by

- [`grid_view_clear_history`](/en/tmux/3.7c/reference/c-function-grid_view_clear_history/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/grid-view.c#L85)
- [`grid_view_scroll_region_up`](/en/tmux/3.7c/reference/c-function-grid_view_scroll_region_up/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/grid-view.c#L110)
- [`session_update_history`](/en/tmux/3.7c/reference/c-function-session_update_history/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L779)

## Calls

- [`grid_trim_history`](/en/tmux/3.7c/reference/c-function-grid-c-grid_trim_history/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/grid.c#L405)

## Referenced declarations

- [`grid`](/en/tmux/3.7c/reference/c-struct-grid/) (struct)
- [`grid.hlimit`](/en/tmux/3.7c/reference/c-struct-grid-hlimit/) (attribute)
- [`grid.hscrolled`](/en/tmux/3.7c/reference/c-struct-grid-hscrolled/) (attribute)
- [`grid.hsize`](/en/tmux/3.7c/reference/c-struct-grid-hsize/) (attribute)
