# tty_set_selection

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2141
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-tty_set_selection/

```c
void tty_set_selection(struct tty *tty, const char *clip, const char *buf, size_t len)
```

## Parameters

- `tty` (`struct tty *`)
- `clip` (`const char *`)
- `buf` (`const char *`)
- `len` (`size_t`)

## Called by

- [`cmd_load_buffer_done`](/en/tmux/3.7c/reference/c-function-cmd-load-buffer-c-cmd_load_buffer_done/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-load-buffer.c#L80)
- [`cmd_set_buffer_exec`](/en/tmux/3.7c/reference/c-function-cmd-set-buffer-c-cmd_set_buffer_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-set-buffer.c#L128)
- [`input_osc_52`](/en/tmux/3.7c/reference/c-function-input-c-input_osc_52/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/input.c#L3287)
- [`tty_cmd_setselection`](/en/tmux/3.7c/reference/c-function-tty_cmd_setselection/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2137)

## Calls

- [`tty_putcode_ss`](/en/tmux/3.7c/reference/c-function-tty_putcode_ss/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2157)
- [`tty_term_has`](/en/tmux/3.7c/reference/c-function-tty_term_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2149)
- [`xmalloc`](/en/tmux/3.7c/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2153)

## Referenced declarations

- [`tty.flags`](/en/tmux/3.7c/reference/c-struct-tty-flags/) (attribute)
- [`tty.term`](/en/tmux/3.7c/reference/c-struct-tty-term/) (attribute)
- [`tty`](/en/tmux/3.7c/reference/c-struct-tty/) (struct)
- [`TTY_NOBLOCK`](/en/tmux/3.7c/reference/c-define-tmux-h-tty_noblock/) (constant)
- [`TTY_STARTED`](/en/tmux/3.7c/reference/c-define-tmux-h-tty_started/) (constant)
- [`TTYC_MS`](/en/tmux/3.7c/reference/c-enum-tty_code_code-ttyc_ms/) (constant)
