2 Commits

Author SHA1 Message Date
Milos Nikic
688f70add0 st: guard tsetdirt() against zero-sized terminal
tsetdirt() assumes term.row > 0. During early init or
resize paths this may not hold, leading to out-of-bounds
access. Bail out early if there are no rows.
2026-01-16 14:12:07 +01:00
Roberto E. Vargas Caballero
0723b7e39e Disable bracked paste in reset
Sadly, there are too many programs today that enable this mode
and it is becoming very common to find the terminal adding
characters before and after in every of your pastes. A reset
should disable this mode.
2025-12-02 20:09:47 +01:00

4
st.c
View File

@@ -965,6 +965,9 @@ tsetdirt(int top, int bot)
{
int i;
if (term.row <= 0)
return;
LIMIT(top, 0, term.row-1);
LIMIT(bot, 0, term.row-1);
@@ -2358,6 +2361,7 @@ eschandle(uchar ascii)
resettitle();
xloadcols();
xsetmode(0, MODE_HIDE);
xsetmode(0, MODE_BRCKTPASTE);
break;
case '=': /* DECPAM -- Application keypad */
xsetmode(1, MODE_APPKEYPAD);