Merge remote-tracking branch 'upstream/master'

master
Jef Roosens 2023-08-07 09:09:54 +02:00
commit b0f0106777
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 19 additions and 5 deletions

24
st.c
View File

@ -1839,11 +1839,18 @@ csihandle(void)
case 'm': /* SGR -- Terminal attribute (color) */ case 'm': /* SGR -- Terminal attribute (color) */
tsetattr(csiescseq.arg, csiescseq.narg); tsetattr(csiescseq.arg, csiescseq.narg);
break; break;
case 'n': /* DSR Device Status Report (cursor position) */ case 'n': /* DSR -- Device Status Report */
if (csiescseq.arg[0] == 6) { switch (csiescseq.arg[0]) {
case 5: /* Status Report "OK" `0n` */
ttywrite("\033[0n", sizeof("\033[0n") - 1, 0);
break;
case 6: /* Report Cursor Position (CPR) "<row>;<column>R" */
len = snprintf(buf, sizeof(buf), "\033[%i;%iR", len = snprintf(buf, sizeof(buf), "\033[%i;%iR",
term.c.y+1, term.c.x+1); term.c.y+1, term.c.x+1);
ttywrite(buf, len, 0); ttywrite(buf, len, 0);
break;
default:
goto unknown;
} }
break; break;
case 'r': /* DECSTBM -- Set Scrolling Region */ case 'r': /* DECSTBM -- Set Scrolling Region */
@ -2002,8 +2009,10 @@ strhandle(void)
if (p && !strcmp(p, "?")) { if (p && !strcmp(p, "?")) {
osc_color_response(j, 0, 1); osc_color_response(j, 0, 1);
} else if (xsetcolorname(j, p)) { } else if (xsetcolorname(j, p)) {
if (par == 104 && narg <= 1) if (par == 104 && narg <= 1) {
xloadcols();
return; /* color reset without parameter */ return; /* color reset without parameter */
}
fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
j, p ? p : "(null)"); j, p ? p : "(null)");
} else { } else {
@ -2483,6 +2492,9 @@ check_control_code:
* they must not cause conflicts with sequences. * they must not cause conflicts with sequences.
*/ */
if (control) { if (control) {
/* in UTF-8 mode ignore handling C1 control characters */
if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
return;
tcontrolcode(u); tcontrolcode(u);
/* /*
* control codes are not shown ever * control codes are not shown ever
@ -2529,8 +2541,10 @@ check_control_code:
gp = &term.line[term.c.y][term.c.x]; gp = &term.line[term.c.y][term.c.x];
} }
if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) {
memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph)); memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph));
gp->mode &= ~ATTR_WIDE;
}
if (term.c.x+width > term.col) { if (term.c.x+width > term.col) {
tnewline(1); tnewline(1);