# screen_write_clearscreen

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1394
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-screen_write_clearscreen/

```c
void screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg)
```

## Parameters

- `ctx` (`struct screen_write_ctx *`)
- `bg` (`u_int`)

## Called by

- [`input_csi_dispatch`](/en/tmux/3.2a/reference/c-function-input-c-input_csi_dispatch/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/input.c#L1498)
- [`input_csi_dispatch_rm_private`](/en/tmux/3.2a/reference/c-function-input-c-input_csi_dispatch_rm_private/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/input.c#L1673)
- [`input_csi_dispatch_sm_private`](/en/tmux/3.2a/reference/c-function-input-c-input_csi_dispatch_sm_private/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/input.c#L1762)
- [`menu_draw_cb`](/en/tmux/3.2a/reference/c-function-menu-c-menu_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/menu.c#L156)
- [`mode_tree_draw`](/en/tmux/3.2a/reference/c-function-mode_tree_draw/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L642)
- [`popup_draw_cb`](/en/tmux/3.2a/reference/c-function-popup-c-popup_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/popup.c#L134)
- [`screen_write_reset`](/en/tmux/3.2a/reference/c-function-screen_write_reset/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L315)
- [`window_clock_draw_screen`](/en/tmux/3.2a/reference/c-function-window-clock-c-window_clock_draw_screen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-clock.c#L235)

## Calls

- [`grid_view_clear`](/en/tmux/3.2a/reference/c-function-grid_view_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1407)
- [`grid_view_clear_history`](/en/tmux/3.2a/reference/c-function-grid_view_clear_history/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1405)
- [`screen_write_collect_clear`](/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_collect_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1409)
- [`screen_write_initctx`](/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_initctx/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1400)
- [`tty_write`](/en/tmux/3.2a/reference/c-function-tty_write/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1410)

## Other function references

- [`tty_cmd_clearscreen`](/en/tmux/3.2a/reference/c-function-tty_cmd_clearscreen/) (function)

## Referenced by

- [`server_client_push_stderr`](/en/tmux/3.2a/reference/c-function-server_client_push_stderr/) (function)

## Referenced declarations

- [`tty_ctx.bg`](/en/tmux/3.2a/reference/c-struct-tty_ctx-bg/) (attribute)
- [`grid.flags`](/en/tmux/3.2a/reference/c-struct-grid-flags/) (attribute)
- [`screen.grid`](/en/tmux/3.2a/reference/c-struct-screen-grid/) (attribute)
- [`GRID_HISTORY`](/en/tmux/3.2a/reference/c-define-tmux-h-grid_history/) (constant)
- [`screen_write_ctx.s`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx-s/) (attribute)
- [`tty_ctx.s`](/en/tmux/3.2a/reference/c-struct-tty_ctx-s/) (attribute)
- [`screen_size_x`](/en/tmux/3.2a/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`screen_size_y`](/en/tmux/3.2a/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`screen_write_ctx`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx/) (struct)
- [`tty_ctx.sx`](/en/tmux/3.2a/reference/c-struct-tty_ctx-sx/) (attribute)
- [`tty_ctx.sy`](/en/tmux/3.2a/reference/c-struct-tty_ctx-sy/) (attribute)
