# screen_write_initctx

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L219
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-screen-write-c-screen_write_initctx/

```c
static void screen_write_initctx(struct screen_write_ctx *ctx, struct tty_ctx *ttyctx, int is_sync, int check_obscured)
```

## Parameters

- `ctx` (`struct screen_write_ctx *`)
- `ttyctx` (`struct tty_ctx *`)
- `is_sync` (`int`)
- `check_obscured` (`int`)

## Called by

- [`screen_write_alignmenttest`](/en/tmux/latest/reference/c-function-screen_write_alignmenttest/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1238)
- [`screen_write_alternateoff`](/en/tmux/latest/reference/c-function-screen_write_alternateoff/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2994)
- [`screen_write_alternateon`](/en/tmux/latest/reference/c-function-screen_write_alternateon/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2970)
- [`screen_write_cell`](/en/tmux/latest/reference/c-function-screen_write_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2524)
- [`screen_write_clearcharacter`](/en/tmux/latest/reference/c-function-screen_write_clearcharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1349)
- [`screen_write_clearendofscreen`](/en/tmux/latest/reference/c-function-screen_write_clearendofscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1789)
- [`screen_write_clearscreen`](/en/tmux/latest/reference/c-function-screen_write_clearscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1942)
- [`screen_write_clearstartofscreen`](/en/tmux/latest/reference/c-function-screen_write_clearstartofscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1869)
- [`screen_write_collect_flush_line`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_collect_flush_line/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2233)
- [`screen_write_collect_flush_scrolled`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_collect_flush_scrolled/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2144)
- [`screen_write_combine`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_combine/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2778)
- [`screen_write_deletecharacter`](/en/tmux/latest/reference/c-function-screen_write_deletecharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1310)
- [`screen_write_deleteline`](/en/tmux/latest/reference/c-function-screen_write_deleteline/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1452)
- [`screen_write_fast_copy`](/en/tmux/latest/reference/c-function-screen_write_fast_copy/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L641)
- [`screen_write_fullredraw`](/en/tmux/latest/reference/c-function-screen_write_fullredraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2002)
- [`screen_write_insertcharacter`](/en/tmux/latest/reference/c-function-screen_write_insertcharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1271)
- [`screen_write_insertline`](/en/tmux/latest/reference/c-function-screen_write_insertline/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1388)
- [`screen_write_rawstring`](/en/tmux/latest/reference/c-function-screen_write_rawstring/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2882)
- [`screen_write_reverseindex`](/en/tmux/latest/reference/c-function-screen_write_reverseindex/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1623)
- [`screen_write_scrolldown`](/en/tmux/latest/reference/c-function-screen_write_scrolldown/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L1738)
- [`screen_write_setselection`](/en/tmux/latest/reference/c-function-screen_write_setselection/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L2867)

## Calls

- [`tty_default_colours`](/en/tmux/latest/reference/c-function-tty_default_colours/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L250)
- [`tty_write`](/en/tmux/latest/reference/c-function-tty_write/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L272)

## Other function references

- [`screen_write_pane_is_obscured`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_pane_is_obscured/) (function)
- [`screen_write_redraw_cb`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_redraw_cb/) (function)
- [`screen_write_set_client_cb`](/en/tmux/latest/reference/c-function-screen-write-c-screen_write_set_client_cb/) (function)
- [`tty_cmd_syncstart`](/en/tmux/latest/reference/c-function-tty_cmd_syncstart/) (function)

## Referenced declarations

- [`window.active`](/en/tmux/latest/reference/c-struct-window-active/) (attribute)
- [`tty_ctx.arg`](/en/tmux/latest/reference/c-struct-tty_ctx-arg/) (attribute)
- [`colour_palette.bg`](/en/tmux/latest/reference/c-struct-colour_palette-bg/) (attribute)
- [`grid_cell.bg`](/en/tmux/latest/reference/c-struct-grid_cell-bg/) (attribute)
- [`screen.cx`](/en/tmux/latest/reference/c-struct-screen-cx/) (attribute)
- [`screen.cy`](/en/tmux/latest/reference/c-struct-screen-cy/) (attribute)
- [`tty_ctx.defaults`](/en/tmux/latest/reference/c-struct-tty_ctx-defaults/) (attribute)
- [`colour_palette.fg`](/en/tmux/latest/reference/c-struct-colour_palette-fg/) (attribute)
- [`grid_cell.fg`](/en/tmux/latest/reference/c-struct-grid_cell-fg/) (attribute)
- [`screen_write_ctx.flags`](/en/tmux/latest/reference/c-struct-screen_write_ctx-flags/) (attribute)
- [`tty_ctx.flags`](/en/tmux/latest/reference/c-struct-tty_ctx-flags/) (attribute)
- [`grid_default_cell`](/en/tmux/latest/reference/c-variable-grid_default_cell/) (attribute)
- [`screen_write_ctx.init_ctx_cb`](/en/tmux/latest/reference/c-struct-screen_write_ctx-init_ctx_cb/) (attribute)
- [`tty_ctx.ocx`](/en/tmux/latest/reference/c-struct-tty_ctx-ocx/) (attribute)
- [`tty_ctx.ocy`](/en/tmux/latest/reference/c-struct-tty_ctx-ocy/) (attribute)
- [`tty_ctx.orlower`](/en/tmux/latest/reference/c-struct-tty_ctx-orlower/) (attribute)
- [`tty_ctx.orupper`](/en/tmux/latest/reference/c-struct-tty_ctx-orupper/) (attribute)
- [`tty_ctx.palette`](/en/tmux/latest/reference/c-struct-tty_ctx-palette/) (attribute)
- [`window_pane.palette`](/en/tmux/latest/reference/c-struct-window_pane-palette/) (attribute)
- [`tty_ctx.redraw_cb`](/en/tmux/latest/reference/c-struct-tty_ctx-redraw_cb/) (attribute)
- [`screen.rlower`](/en/tmux/latest/reference/c-struct-screen-rlower/) (attribute)
- [`screen.rupper`](/en/tmux/latest/reference/c-struct-screen-rupper/) (attribute)
- [`screen_write_ctx.s`](/en/tmux/latest/reference/c-struct-screen_write_ctx-s/) (attribute)
- [`tty_ctx.s`](/en/tmux/latest/reference/c-struct-tty_ctx-s/) (attribute)
- [`screen_size_x`](/en/tmux/latest/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`screen_size_y`](/en/tmux/latest/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`screen_write_ctx`](/en/tmux/latest/reference/c-struct-screen_write_ctx/) (struct)
- [`SCREEN_WRITE_SYNC`](/en/tmux/latest/reference/c-define-tmux-h-screen_write_sync/) (constant)
- [`tty_ctx.set_client_cb`](/en/tmux/latest/reference/c-struct-tty_ctx-set_client_cb/) (attribute)
- [`tty_ctx.sx`](/en/tmux/latest/reference/c-struct-tty_ctx-sx/) (attribute)
- [`tty_ctx.sy`](/en/tmux/latest/reference/c-struct-tty_ctx-sy/) (attribute)
- [`tty_ctx`](/en/tmux/latest/reference/c-struct-tty_ctx/) (struct)
- [`TTY_CTX_OVERLAY_SYNC`](/en/tmux/latest/reference/c-define-tmux-h-tty_ctx_overlay_sync/) (constant)
- [`TTY_CTX_PANE_OBSCURED`](/en/tmux/latest/reference/c-define-tmux-h-tty_ctx_pane_obscured/) (constant)
- [`TTY_CTX_SYNC`](/en/tmux/latest/reference/c-define-tmux-h-tty_ctx_sync/) (constant)
- [`window_pane.window`](/en/tmux/latest/reference/c-struct-window_pane-window/) (attribute)
- [`screen_write_ctx.wp`](/en/tmux/latest/reference/c-struct-screen_write_ctx-wp/) (attribute)
