# screen_set_selection

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

```c
void screen_set_selection(struct screen *s, u_int sx, u_int sy, u_int ex, u_int ey, u_int rectangle, u_int clipx, int modekeys, struct grid_cell *gc)
```

## Parameters

- `s` (`struct screen *`)
- `sx` (`u_int`)
- `sy` (`u_int`)
- `ex` (`u_int`)
- `ey` (`u_int`)
- `rectangle` (`u_int`)
- `clipx` (`u_int`)
- `modekeys` (`int`)
- `gc` (`struct grid_cell *`)

## Called by

- [`window_copy_set_selection`](/en/tmux/latest/reference/c-function-window-copy-c-window_copy_set_selection/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-copy.c#L5330)

## Calls

- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen.c#L486)

## Referenced declarations

- [`screen_sel.cell`](/en/tmux/latest/reference/c-struct-screen_sel-cell/) (attribute)
- [`screen_sel.clipx`](/en/tmux/latest/reference/c-struct-screen_sel-clipx/) (attribute)
- [`screen_sel.ex`](/en/tmux/latest/reference/c-struct-screen_sel-ex/) (attribute)
- [`screen_sel.ey`](/en/tmux/latest/reference/c-struct-screen_sel-ey/) (attribute)
- [`grid_cell`](/en/tmux/latest/reference/c-struct-grid_cell/) (struct)
- [`screen_sel.hidden`](/en/tmux/latest/reference/c-struct-screen_sel-hidden/) (attribute)
- [`screen_sel.modekeys`](/en/tmux/latest/reference/c-struct-screen_sel-modekeys/) (attribute)
- [`screen_sel.rectangle`](/en/tmux/latest/reference/c-struct-screen_sel-rectangle/) (attribute)
- [`screen`](/en/tmux/latest/reference/c-struct-screen/) (struct)
- [`screen.sel`](/en/tmux/latest/reference/c-struct-screen-sel/) (attribute)
- [`grid.sx`](/en/tmux/latest/reference/c-struct-grid-sx/) (attribute)
- [`screen_sel.sx`](/en/tmux/latest/reference/c-struct-screen_sel-sx/) (attribute)
- [`grid.sy`](/en/tmux/latest/reference/c-struct-grid-sy/) (attribute)
- [`screen_sel.sy`](/en/tmux/latest/reference/c-struct-screen_sel-sy/) (attribute)
