# tty_draw_line

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L93
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-tty_draw_line/

```c
void tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx, u_int atx, u_int aty, const struct grid_cell *defaults, struct colour_palette *palette)
```

## Parameters

- `tty` (`struct tty *`)
- `s` (`struct screen *`)
- `px` (`u_int`)
- `py` (`u_int`)
- `nx` (`u_int`)
- `atx` (`u_int`)
- `aty` (`u_int`)
- `defaults` (`const struct grid_cell *`)
- `palette` (`struct colour_palette *`)

## Called by

- [`menu_draw_cb`](/en/tmux/latest/reference/c-function-menu_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L285)
- [`popup_draw_cb`](/en/tmux/latest/reference/c-function-popup-c-popup_draw_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/popup.c#L336)
- [`screen_redraw_draw_pane`](/en/tmux/latest/reference/c-function-screen-redraw-c-screen_redraw_draw_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-redraw.c#L1382)
- [`screen_redraw_draw_pane_status`](/en/tmux/latest/reference/c-function-screen-redraw-c-screen_redraw_draw_pane_status/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-redraw.c#L727)
- [`screen_redraw_draw_status`](/en/tmux/latest/reference/c-function-screen-redraw-c-screen_redraw_draw_status/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-redraw.c#L1104)
- [`tty_cmd_cell`](/en/tmux/latest/reference/c-function-tty_cmd_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2063)
- [`tty_cmd_redrawline`](/en/tmux/latest/reference/c-function-tty_cmd_redrawline/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1448)
- [`tty_draw_pane`](/en/tmux/latest/reference/c-function-tty-c-tty_draw_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L1417)

## Calls

- [`fatalx`](/en/tmux/latest/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L211)
- [`grid_get_line`](/en/tmux/latest/reference/c-function-grid_get_line/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L127)
- [`grid_view_get_cell`](/en/tmux/latest/reference/c-function-grid_view_get_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L154)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L112)
- [`log_get_level`](/en/tmux/latest/reference/c-function-log_get_level/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L267)
- [`screen_select_cell`](/en/tmux/latest/reference/c-function-screen_select_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L172)
- [`tty_attributes`](/en/tmux/latest/reference/c-function-tty_attributes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L176)
- [`tty_check_codeset`](/en/tmux/latest/reference/c-function-tty_check_codeset/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L217)
- [`tty_cursor`](/en/tmux/latest/reference/c-function-tty_cursor/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L287)
- [`tty_default_attributes`](/en/tmux/latest/reference/c-function-tty_default_attributes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L146)
- [`tty_draw_line_clear`](/en/tmux/latest/reference/c-function-tty-draw-c-tty_draw_line_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L178)
- [`tty_margin_off`](/en/tmux/latest/reference/c-function-tty_margin_off/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L141)
- [`tty_putc`](/en/tmux/latest/reference/c-function-tty_putc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L292)
- [`tty_putn`](/en/tmux/latest/reference/c-function-tty_putn/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L289)
- [`tty_region_off`](/en/tmux/latest/reference/c-function-tty_region_off/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L140)
- [`tty_update_mode`](/en/tmux/latest/reference/c-function-tty_update_mode/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-draw.c#L139)

## Other function references

- [`grid_cells_look_equal`](/en/tmux/latest/reference/c-function-grid_cells_look_equal/) (function)

## Referenced declarations

- [`grid_cell.attr`](/en/tmux/latest/reference/c-struct-grid_cell-attr/) (attribute)
- [`grid_cell.bg`](/en/tmux/latest/reference/c-struct-grid_cell-bg/) (attribute)
- [`grid_line.cellsize`](/en/tmux/latest/reference/c-struct-grid_line-cellsize/) (attribute)
- [`colour_palette`](/en/tmux/latest/reference/c-struct-colour_palette/) (struct)
- [`tty.cx`](/en/tmux/latest/reference/c-struct-tty-cx/) (attribute)
- [`grid_cell.data`](/en/tmux/latest/reference/c-struct-grid_cell-data/) (attribute)
- [`utf8_data.data`](/en/tmux/latest/reference/c-struct-utf8_data-data/) (attribute)
- [`grid_cell.fg`](/en/tmux/latest/reference/c-struct-grid_cell-fg/) (attribute)
- [`grid_cell.flags`](/en/tmux/latest/reference/c-struct-grid_cell-flags/) (attribute)
- [`grid_line.flags`](/en/tmux/latest/reference/c-struct-grid_line-flags/) (attribute)
- [`tty.flags`](/en/tmux/latest/reference/c-struct-tty-flags/) (attribute)
- [`screen.grid`](/en/tmux/latest/reference/c-struct-screen-grid/) (attribute)
- [`GRID_ATTR_CHARSET`](/en/tmux/latest/reference/c-define-tmux-h-grid_attr_charset/) (constant)
- [`grid_cell`](/en/tmux/latest/reference/c-struct-grid_cell/) (struct)
- [`grid_default_cell`](/en/tmux/latest/reference/c-variable-grid_default_cell/) (attribute)
- [`GRID_FLAG_CLEARED`](/en/tmux/latest/reference/c-define-tmux-h-grid_flag_cleared/) (constant)
- [`GRID_FLAG_PADDING`](/en/tmux/latest/reference/c-define-tmux-h-grid_flag_padding/) (constant)
- [`GRID_FLAG_SELECTED`](/en/tmux/latest/reference/c-define-tmux-h-grid_flag_selected/) (constant)
- [`GRID_FLAG_TAB`](/en/tmux/latest/reference/c-define-tmux-h-grid_flag_tab/) (constant)
- [`GRID_LINE_WRAPPED`](/en/tmux/latest/reference/c-define-tmux-h-grid_line_wrapped/) (constant)
- [`grid.hsize`](/en/tmux/latest/reference/c-struct-grid-hsize/) (attribute)
- [`screen.hyperlinks`](/en/tmux/latest/reference/c-struct-screen-hyperlinks/) (attribute)
- [`grid_cell.link`](/en/tmux/latest/reference/c-struct-grid_cell-link/) (attribute)
- [`tty.mode`](/en/tmux/latest/reference/c-struct-tty-mode/) (attribute)
- [`screen`](/en/tmux/latest/reference/c-struct-screen/) (struct)
- [`screen_size_x`](/en/tmux/latest/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`utf8_data.size`](/en/tmux/latest/reference/c-struct-utf8_data-size/) (attribute)
- [`tty.sx`](/en/tmux/latest/reference/c-struct-tty-sx/) (attribute)
- [`tty`](/en/tmux/latest/reference/c-struct-tty/) (struct)
- [`TTY_DRAW_LINE_DONE`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_done/) (constant)
- [`TTY_DRAW_LINE_EMPTY`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_empty/) (constant)
- [`TTY_DRAW_LINE_FIRST`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_first/) (constant)
- [`TTY_DRAW_LINE_FLUSH`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_flush/) (constant)
- [`TTY_DRAW_LINE_NEW1`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_new1/) (constant)
- [`TTY_DRAW_LINE_NEW2`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_new2/) (constant)
- [`TTY_DRAW_LINE_SAME`](/en/tmux/latest/reference/c-enum-tty_draw_line_state-tty_draw_line_same/) (constant)
- [`tty_draw_line_states`](/en/tmux/latest/reference/c-variable-tty-draw-c-tty_draw_line_states/) (attribute)
- [`TTY_NOCURSOR`](/en/tmux/latest/reference/c-define-tmux-h-tty_nocursor/) (constant)
- [`utf8_data.width`](/en/tmux/latest/reference/c-struct-utf8_data-width/) (attribute)
