# screen_write_clearscreen

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1928
- **Page:** https://libtmux.org/en/tmux/3.7c/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.7c/reference/c-function-input-c-input_csi_dispatch/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/input.c#L1725)
- [`input_csi_dispatch_rm_private`](/en/tmux/3.7c/reference/c-function-input-c-input_csi_dispatch_rm_private/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/input.c#L1915)
- [`input_csi_dispatch_sm_private`](/en/tmux/3.7c/reference/c-function-input-c-input_csi_dispatch_sm_private/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/input.c#L2014)
- [`menu_draw_cb`](/en/tmux/3.7c/reference/c-function-menu_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L273)
- [`mode_tree_draw`](/en/tmux/3.7c/reference/c-function-mode_tree_draw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L763)
- [`popup_draw_cb`](/en/tmux/3.7c/reference/c-function-popup-c-popup_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/popup.c#L308)
- [`screen_write_reset`](/en/tmux/3.7c/reference/c-function-screen_write_reset/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L384)
- [`window_clock_draw_screen`](/en/tmux/3.7c/reference/c-function-window-clock-c-window_clock_draw_screen/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-clock.c#L258)

## Calls

- [`grid_view_clear`](/en/tmux/3.7c/reference/c-function-grid_view_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1951)
- [`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/screen-write.c#L1949)
- [`screen_redraw_get_visible_ranges`](/en/tmux/3.7c/reference/c-function-screen_redraw_get_visible_ranges/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1974)
- [`screen_write_collect_clear`](/en/tmux/3.7c/reference/c-function-screen-write-c-screen_write_collect_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1953)
- [`screen_write_collect_insert_clear`](/en/tmux/3.7c/reference/c-function-screen-write-c-screen_write_collect_insert_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1980)
- [`screen_write_initctx`](/en/tmux/3.7c/reference/c-function-screen-write-c-screen_write_initctx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1942)
- [`screen_write_set_cursor`](/en/tmux/3.7c/reference/c-function-screen-write-c-screen_write_set_cursor/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1973)
- [`tty_write`](/en/tmux/3.7c/reference/c-function-tty_write/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1956)

## Other function references

- [`options_get_number`](/en/tmux/3.7c/reference/c-function-options_get_number/) (function)
- [`tty_cmd_clearscreen`](/en/tmux/3.7c/reference/c-function-tty_cmd_clearscreen/) (function)

## Referenced declarations

- [`tty_ctx.bg`](/en/tmux/3.7c/reference/c-struct-tty_ctx-bg/) (attribute)
- [`screen.cx`](/en/tmux/3.7c/reference/c-struct-screen-cx/) (attribute)
- [`screen.cy`](/en/tmux/3.7c/reference/c-struct-screen-cy/) (attribute)
- [`grid.flags`](/en/tmux/3.7c/reference/c-struct-grid-flags/) (attribute)
- [`tty_ctx.flags`](/en/tmux/3.7c/reference/c-struct-tty_ctx-flags/) (attribute)
- [`window_pane.flags`](/en/tmux/3.7c/reference/c-struct-window_pane-flags/) (attribute)
- [`screen.grid`](/en/tmux/3.7c/reference/c-struct-screen-grid/) (attribute)
- [`GRID_HISTORY`](/en/tmux/3.7c/reference/c-define-tmux-h-grid_history/) (constant)
- [`visible_range.nx`](/en/tmux/3.7c/reference/c-struct-visible_range-nx/) (attribute)
- [`tty_ctx.ocx`](/en/tmux/3.7c/reference/c-struct-tty_ctx-ocx/) (attribute)
- [`tty_ctx.ocy`](/en/tmux/3.7c/reference/c-struct-tty_ctx-ocy/) (attribute)
- [`window_pane.options`](/en/tmux/3.7c/reference/c-struct-window_pane-options/) (attribute)
- [`PANE_REDRAW`](/en/tmux/3.7c/reference/c-define-tmux-h-pane_redraw/) (constant)
- [`visible_range.px`](/en/tmux/3.7c/reference/c-struct-visible_range-px/) (attribute)
- [`visible_ranges.ranges`](/en/tmux/3.7c/reference/c-struct-visible_ranges-ranges/) (attribute)
- [`screen_write_ctx.s`](/en/tmux/3.7c/reference/c-struct-screen_write_ctx-s/) (attribute)
- [`tty_ctx.s`](/en/tmux/3.7c/reference/c-struct-tty_ctx-s/) (attribute)
- [`screen_size_x`](/en/tmux/3.7c/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`screen_size_y`](/en/tmux/3.7c/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`screen_write_ctx`](/en/tmux/3.7c/reference/c-struct-screen_write_ctx/) (struct)
- [`tty_ctx.sx`](/en/tmux/3.7c/reference/c-struct-tty_ctx-sx/) (attribute)
- [`tty_ctx.sy`](/en/tmux/3.7c/reference/c-struct-tty_ctx-sy/) (attribute)
- [`TTY_CTX_PANE_OBSCURED`](/en/tmux/3.7c/reference/c-define-tmux-h-tty_ctx_pane_obscured/) (constant)
- [`visible_ranges.used`](/en/tmux/3.7c/reference/c-struct-visible_ranges-used/) (attribute)
- [`screen_write_ctx.wp`](/en/tmux/3.7c/reference/c-struct-screen_write_ctx-wp/) (attribute)
- [`tty_ctx.xoff`](/en/tmux/3.7c/reference/c-struct-tty_ctx-xoff/) (attribute)
- [`window_pane.xoff`](/en/tmux/3.7c/reference/c-struct-window_pane-xoff/) (attribute)
- [`tty_ctx.yoff`](/en/tmux/3.7c/reference/c-struct-tty_ctx-yoff/) (attribute)
- [`window_pane.yoff`](/en/tmux/3.7c/reference/c-struct-window_pane-yoff/) (attribute)
