Remove globals 'li' and 'co' in term.c

These globals were used to store the original terminal dimesions from the terminal database (or
in the case of reattaching, supplied by scr-bx) to be applied if the current terminal dimensions
could not be determined.

Instead, we leave the original terminal dimensions in current_term->TI_lines and current_term->TI_cols,
and create current_term->li and current_term->co to store the current terminal dimensions (as eg.
supplied by scr-bx).
This commit is contained in:
Kevin Easton
2017-09-15 17:15:24 +10:00
parent c9b0e654b5
commit 70ac43ce77
8 changed files with 67 additions and 64 deletions

View File

@@ -1500,8 +1500,8 @@ Screen * BX_create_new_screen(void)
new->fdin = fileno(stdin);
new->alive = 1;
new->li = current_term->TI_lines;
new->co = current_term->TI_cols;
new->li = current_term->li;
new->co = current_term->co;
new->old_li = 0;
new->old_co = 0;
new->buffer_pos = new->buffer_min_pos = 0;
@@ -1651,7 +1651,7 @@ extern Window *BX_create_additional_screen (void)
}
else if (screen_type == ST_XTERM)
{
snprintf(geom, sizeof geom, "%dx%d", current_term->TI_cols, current_term->TI_lines);
snprintf(geom, sizeof geom, "%dx%d", current_term->co, current_term->li);
opts = LOCAL_COPY(get_string_var(XTERM_OPTIONS_VAR));
if (!(xterm = getenv("XTERM")))
if (!(xterm = get_string_var(XTERM_VAR)))