# screen_write_initctx

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L167
- **Page:** https://libtmux.org/en/tmux/3.2a/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 sync)
```

## Parameters

- `ctx` (`struct screen_write_ctx *`)
- `ttyctx` (`struct tty_ctx *`)
- `sync` (`int`)

## Called by

- [`screen_write_alignmenttest`](/en/tmux/3.2a/reference/c-function-screen_write_alignmenttest/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L923)
- [`screen_write_alternateoff`](/en/tmux/3.2a/reference/c-function-screen_write_alternateoff/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L2028)
- [`screen_write_alternateon`](/en/tmux/3.2a/reference/c-function-screen_write_alternateon/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L2010)
- [`screen_write_cell`](/en/tmux/3.2a/reference/c-function-screen_write_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1741)
- [`screen_write_clearcharacter`](/en/tmux/3.2a/reference/c-function-screen_write_clearcharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1003)
- [`screen_write_clearendofscreen`](/en/tmux/3.2a/reference/c-function-screen_write_clearendofscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1352)
- [`screen_write_clearscreen`](/en/tmux/3.2a/reference/c-function-screen_write_clearscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1400)
- [`screen_write_clearstartofscreen`](/en/tmux/3.2a/reference/c-function-screen_write_clearstartofscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1377)
- [`screen_write_collect_flush`](/en/tmux/3.2a/reference/c-function-screen-write-c-screen_write_collect_flush/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1566)
- [`screen_write_deletecharacter`](/en/tmux/3.2a/reference/c-function-screen_write_deletecharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L975)
- [`screen_write_deleteline`](/en/tmux/3.2a/reference/c-function-screen_write_deleteline/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1077)
- [`screen_write_insertcharacter`](/en/tmux/3.2a/reference/c-function-screen_write_insertcharacter/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L947)
- [`screen_write_insertline`](/en/tmux/3.2a/reference/c-function-screen_write_insertline/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1030)
- [`screen_write_rawstring`](/en/tmux/3.2a/reference/c-function-screen_write_rawstring/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1989)
- [`screen_write_reverseindex`](/en/tmux/3.2a/reference/c-function-screen_write_reverseindex/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1226)
- [`screen_write_scrolldown`](/en/tmux/3.2a/reference/c-function-screen_write_scrolldown/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1320)
- [`screen_write_setselection`](/en/tmux/3.2a/reference/c-function-screen_write_setselection/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1976)

## Calls

- [`tty_default_colours`](/en/tmux/3.2a/reference/c-function-tty_default_colours/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L175)
- [`tty_write`](/en/tmux/3.2a/reference/c-function-tty_write/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L206)

## Other function references

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

## Referenced declarations

- [`window.active`](/en/tmux/3.2a/reference/c-struct-window-active/) (attribute)
- [`tty_ctx.arg`](/en/tmux/3.2a/reference/c-struct-tty_ctx-arg/) (attribute)
- [`screen.cx`](/en/tmux/3.2a/reference/c-struct-screen-cx/) (attribute)
- [`screen.cy`](/en/tmux/3.2a/reference/c-struct-screen-cy/) (attribute)
- [`tty_ctx.defaults`](/en/tmux/3.2a/reference/c-struct-tty_ctx-defaults/) (attribute)
- [`screen_write_ctx.flags`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx-flags/) (attribute)
- [`grid_default_cell`](/en/tmux/3.2a/reference/c-variable-grid_default_cell/) (attribute)
- [`screen_write_ctx.init_ctx_cb`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx-init_ctx_cb/) (attribute)
- [`tty_ctx.ocx`](/en/tmux/3.2a/reference/c-struct-tty_ctx-ocx/) (attribute)
- [`tty_ctx.ocy`](/en/tmux/3.2a/reference/c-struct-tty_ctx-ocy/) (attribute)
- [`tty_ctx.orlower`](/en/tmux/3.2a/reference/c-struct-tty_ctx-orlower/) (attribute)
- [`tty_ctx.orupper`](/en/tmux/3.2a/reference/c-struct-tty_ctx-orupper/) (attribute)
- [`tty_ctx.palette`](/en/tmux/3.2a/reference/c-struct-tty_ctx-palette/) (attribute)
- [`window_pane.palette`](/en/tmux/3.2a/reference/c-struct-window_pane-palette/) (attribute)
- [`tty_ctx.redraw_cb`](/en/tmux/3.2a/reference/c-struct-tty_ctx-redraw_cb/) (attribute)
- [`screen.rlower`](/en/tmux/3.2a/reference/c-struct-screen-rlower/) (attribute)
- [`screen.rupper`](/en/tmux/3.2a/reference/c-struct-screen-rupper/) (attribute)
- [`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)
- [`SCREEN_WRITE_SYNC`](/en/tmux/3.2a/reference/c-define-tmux-h-screen_write_sync/) (constant)
- [`tty_ctx.set_client_cb`](/en/tmux/3.2a/reference/c-struct-tty_ctx-set_client_cb/) (attribute)
- [`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)
- [`tty_ctx`](/en/tmux/3.2a/reference/c-struct-tty_ctx/) (struct)
- [`window_pane.window`](/en/tmux/3.2a/reference/c-struct-window_pane-window/) (attribute)
- [`screen_write_ctx.wp`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx-wp/) (attribute)
