Use current screen size rather than original terminal size in term_clear_screen()
Also renames the function term_clrscr() to term_clear_screen() and remove the term_clear_screen() macro.
This commit is contained in:
@@ -698,7 +698,6 @@ int tputs_x(char *);
|
|||||||
#define term_cursor_left() term_left(1)
|
#define term_cursor_left() term_left(1)
|
||||||
#define term_cursor_right() term_right(1)
|
#define term_cursor_right() term_right(1)
|
||||||
#define term_clear_to_eol() term_clreol()
|
#define term_clear_to_eol() term_clreol()
|
||||||
#define term_clear_screen() term_clrscr()
|
|
||||||
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
extern int vio_screen;
|
extern int vio_screen;
|
||||||
@@ -720,7 +719,7 @@ SIGNAL_HANDLER(term_cont);
|
|||||||
void term_right (int);
|
void term_right (int);
|
||||||
void term_left (int);
|
void term_left (int);
|
||||||
void term_clreol (void);
|
void term_clreol (void);
|
||||||
void term_clrscr (void);
|
void term_clear_screen (void);
|
||||||
void term_gotoxy (int, int);
|
void term_gotoxy (int, int);
|
||||||
void term_reset (void);
|
void term_reset (void);
|
||||||
int term_eight_bit (void);
|
int term_eight_bit (void);
|
||||||
|
|||||||
@@ -1351,15 +1351,16 @@ void term_gotoxy (int col, int row)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* A no-brainer. Clear the screen. */
|
/* A no-brainer. Clear the screen. */
|
||||||
void term_clrscr (void)
|
void term_clear_screen(void)
|
||||||
{
|
{
|
||||||
#if defined(__EMX__) && !defined(__EMXX__) && !defined(GUI)
|
#if defined(__EMX__) && !defined(__EMXX__) && !defined(GUI)
|
||||||
VioScrollUp(0, 0, -1, -1, -1, &default_pair, vio_screen);
|
VioScrollUp(0, 0, -1, -1, -1, &default_pair, vio_screen);
|
||||||
#elif defined(GUI)
|
#elif defined(GUI)
|
||||||
gui_clrscr();
|
gui_clrscr();
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
/* This is called from scr-bx with output_screen == NULL */
|
||||||
|
const long li = output_screen ? output_screen->li : current_term->li;
|
||||||
|
|
||||||
/* We have a specific cap for clearing the screen */
|
/* We have a specific cap for clearing the screen */
|
||||||
if (current_term->TI_clear)
|
if (current_term->TI_clear)
|
||||||
@@ -1379,27 +1380,27 @@ void term_clrscr (void)
|
|||||||
/* We can also clear by deleteing lines ... */
|
/* We can also clear by deleteing lines ... */
|
||||||
else if (current_term->TI_dl)
|
else if (current_term->TI_dl)
|
||||||
{
|
{
|
||||||
tputs_x(tparm1(current_term->TI_dl, current_term->TI_lines));
|
tputs_x(tparm1(current_term->TI_dl, li));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* ... in this case one line at a time */
|
/* ... in this case one line at a time */
|
||||||
else if (current_term->TI_dl1)
|
else if (current_term->TI_dl1)
|
||||||
{
|
{
|
||||||
for (i = 0; i < current_term->TI_lines; i++)
|
for (i = 0; i < li; i++)
|
||||||
tputs_x(current_term->TI_dl1);
|
tputs_x(current_term->TI_dl1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* As a last resort we can insert lines ... */
|
/* As a last resort we can insert lines ... */
|
||||||
else if (current_term->TI_il)
|
else if (current_term->TI_il)
|
||||||
{
|
{
|
||||||
tputs_x(tparm1(current_term->TI_il, current_term->TI_lines));
|
tputs_x(tparm1(current_term->TI_il, li));
|
||||||
term_gotoxy (0, 0);
|
term_gotoxy (0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* ... one line at a time */
|
/* ... one line at a time */
|
||||||
else if (current_term->TI_il1)
|
else if (current_term->TI_il1)
|
||||||
{
|
{
|
||||||
for (i = 0; i < current_term->TI_lines; i++)
|
for (i = 0; i < li; i++)
|
||||||
tputs_x(current_term->TI_il1);
|
tputs_x(current_term->TI_il1);
|
||||||
term_gotoxy (0, 0);
|
term_gotoxy (0, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user