# screen_write_setselection

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

```c
void screen_write_setselection(struct screen_write_ctx *ctx, u_char *str, u_int len)
```

## Parameters

- `ctx` (`struct screen_write_ctx *`)
- `str` (`u_char *`)
- `len` (`u_int`)

## Called by

- [`input_osc_52`](/en/tmux/3.2a/reference/c-function-input-c-input_osc_52/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/input.c#L2684)
- [`window_copy_append_selection`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_append_selection/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L4158)
- [`window_copy_copy_buffer`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_copy_buffer/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L4084)

## Calls

- [`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#L1976)
- [`tty_write`](/en/tmux/3.2a/reference/c-function-tty_write/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen-write.c#L1980)

## Other function references

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

## Referenced by

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

## Referenced declarations

- [`tty_ctx.num`](/en/tmux/3.2a/reference/c-struct-tty_ctx-num/) (attribute)
- [`tty_ctx.ptr`](/en/tmux/3.2a/reference/c-struct-tty_ctx-ptr/) (attribute)
- [`screen_write_ctx`](/en/tmux/3.2a/reference/c-struct-screen_write_ctx/) (struct)
