# tty_clamp_line

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

```c
static int tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py, u_int nx, u_int *i, u_int *x, u_int *rx, u_int *ry)
```

## Parameters

- `tty` (`struct tty *`)
- `ctx` (`const struct tty_ctx *`)
- `px` (`u_int`)
- `py` (`u_int`)
- `nx` (`u_int`)
- `i` (`u_int *`)
- `x` (`u_int *`)
- `rx` (`u_int *`)
- `ry` (`u_int *`)

## Called by

- [`tty_clear_pane_line`](/en/tmux/3.7c/reference/c-function-tty-c-tty_clear_pane_line/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1239)
- [`tty_cmd_redrawline`](/en/tmux/3.7c/reference/c-function-tty_cmd_redrawline/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1441)
- [`tty_draw_pane`](/en/tmux/3.7c/reference/c-function-tty-c-tty_draw_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1422)

## Calls

- [`fatalx`](/en/tmux/3.7c/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1168)
- [`tty_is_visible`](/en/tmux/3.7c/reference/c-function-tty-c-tty_is_visible/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1142)

## Referenced declarations

- [`tty_ctx.rxoff`](/en/tmux/3.7c/reference/c-struct-tty_ctx-rxoff/) (attribute)
- [`tty`](/en/tmux/3.7c/reference/c-struct-tty/) (struct)
- [`tty_ctx`](/en/tmux/3.7c/reference/c-struct-tty_ctx/) (struct)
- [`tty_ctx.wox`](/en/tmux/3.7c/reference/c-struct-tty_ctx-wox/) (attribute)
- [`tty_ctx.woy`](/en/tmux/3.7c/reference/c-struct-tty_ctx-woy/) (attribute)
- [`tty_ctx.wsx`](/en/tmux/3.7c/reference/c-struct-tty_ctx-wsx/) (attribute)
- [`tty_ctx.xoff`](/en/tmux/3.7c/reference/c-struct-tty_ctx-xoff/) (attribute)
- [`tty_ctx.yoff`](/en/tmux/3.7c/reference/c-struct-tty_ctx-yoff/) (attribute)
