aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShivesh Mandalia <mail@shivesh.org>2023-02-11 20:40:58 +0000
committerShivesh Mandalia <mail@shivesh.org>2023-02-11 20:40:58 +0000
commitbe156b33d1e38031e2bdc527d22262bf65ce98b9 (patch)
tree121357b2cd44defb506f36179f47ec6fb5338d79
parent6ee58011f64322e8e135f2b8d141cc10065a14c4 (diff)
parent211964d56ee00a7d46e251cbc150afb79138ae37 (diff)
downloadst-be156b33d1e38031e2bdc527d22262bf65ce98b9.tar.gz
st-be156b33d1e38031e2bdc527d22262bf65ce98b9.zip
Merge branch 'master' into shivesh
-rw-r--r--st.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/st.c b/st.c
index aba015b..9bdf231 100644
--- a/st.c
+++ b/st.c
@@ -1836,11 +1836,18 @@ csihandle(void)
case 'm': /* SGR -- Terminal attribute (color) */
tsetattr(csiescseq.arg, csiescseq.narg);
break;
- case 'n': /* DSR – Device Status Report (cursor position) */
- if (csiescseq.arg[0] == 6) {
+ case 'n': /* DSR -- Device Status Report */
+ 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",
- term.c.y+1, term.c.x+1);
+ term.c.y+1, term.c.x+1);
ttywrite(buf, len, 0);
+ break;
+ default:
+ goto unknown;
}
break;
case 'r': /* DECSTBM -- Set Scrolling Region */
@@ -1999,8 +2006,10 @@ strhandle(void)
if (p && !strcmp(p, "?")) {
osc_color_response(j, 0, 1);
} else if (xsetcolorname(j, p)) {
- if (par == 104 && narg <= 1)
+ if (par == 104 && narg <= 1) {
+ xloadcols();
return; /* color reset without parameter */
+ }
fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
j, p ? p : "(null)");
} else {
@@ -2480,6 +2489,9 @@ check_control_code:
* they must not cause conflicts with sequences.
*/
if (control) {
+ /* in UTF-8 mode ignore handling C1 control characters */
+ if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
+ return;
tcontrolcode(u);
/*
* control codes are not shown ever