summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-04-11 20:56:44 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-04-11 20:56:44 -0600
commit0142f4efac1d5e5d4c620f8c3404d41c4880a6d0 (patch)
treeaf650aa33805f0c309dc4c8ad3e178bf000fd1b1
parent8da17f89ad37570a769023ad30da4b777b25beba (diff)
parent48b8ee6e181643800fe83353ec554f503020a8fa (diff)
Merge commit 48b8ee from maxtroeger/patch-1 in origin/master.HEADmaster
Fix "Did not detect DSR response".
-rw-r--r--st.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/st.c b/st.c
index f1e0724..7256475 100644
--- a/st.c
+++ b/st.c
@@ -1852,11 +1852,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);
ttywrite(buf, len, 0);
+ break;
+ default:
+ goto unknown;
}
break;
case 'r': /* DECSTBM -- Set Scrolling Region */