# grid_trim_history

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L337
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-grid-c-grid_trim_history/

```c
static void grid_trim_history(struct grid *gd, u_int ny)
```

## Parameters

- `gd` (`struct grid *`)
- `ny` (`u_int`)

## Called by

- [`grid_clear_history`](/en/tmux/3.2a/reference/c-function-grid_clear_history/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L409)
- [`grid_collect_history`](/en/tmux/3.2a/reference/c-function-grid_collect_history/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L366)

## Calls

- [`grid_free_lines`](/en/tmux/3.2a/reference/c-function-grid-c-grid_free_lines/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L339)

## Referenced declarations

- [`grid`](/en/tmux/3.2a/reference/c-struct-grid/) (struct)
- [`grid.hsize`](/en/tmux/3.2a/reference/c-struct-grid-hsize/) (attribute)
- [`grid.linedata`](/en/tmux/3.2a/reference/c-struct-grid-linedata/) (attribute)
- [`grid.sy`](/en/tmux/3.2a/reference/c-struct-grid-sy/) (attribute)
