Adding clearing of images and scrollback history when using clear ref. #30

This commit is contained in:
bakkeby 2021-07-19 10:14:56 +02:00
parent 286db8098b
commit d1b9cca73c
2 changed files with 17 additions and 2 deletions

17
st.c
View File

@ -2201,9 +2201,24 @@ csihandle(void)
tclearregion(0, 0, term.col-1, term.c.y-1);
tclearregion(0, term.c.y, term.c.x, term.c.y);
break;
case 2: /* all */
case 2: /* screen */
tclearregion(0, 0, term.col-1, term.row-1);
break;
case 3: /* all including scrollback */
tclearregion(0, 0, term.col-1, term.row-1);
#if SCROLLBACK_PATCH
term.scr = 0;
term.histi = 0;
for (int i = 0; i < HISTSIZE; i++)
term.hist[i][0].u = '\0';
#endif // SCROLLBACK_PATCH
#if SIXEL_PATCH
for (im = term.images; im; im = im->next)
im->should_delete = 1;
#endif // SIXEL_PATCH
break;
default:
goto unknown;
}

View File

@ -10,7 +10,7 @@ st-mono| simpleterm monocolor,
cbt=\E[Z,
cvvis=\E[?25h,
civis=\E[?25l,
clear=\E[H\E[2J,
clear=\E[H\E[3J,
cnorm=\E[?12l\E[?25h,
colors#2,
cols#80,