aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk2
-rw-r--r--st.c47
2 files changed, 34 insertions, 15 deletions
diff --git a/config.mk b/config.mk
index 69f0498..12ca220 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
# st version
-VERSION = 0.9.2
+VERSION = 0.9.3
# Customize below to fit your system
diff --git a/st.c b/st.c
index 686e1a2..2df7f1e 100644
--- a/st.c
+++ b/st.c
@@ -1708,14 +1708,14 @@ tsetattr(const int *attr, int l)
if ((idx = tdefcolor(attr, &i, l)) >= 0)
term.c.attr.fg = idx;
break;
- case 39:
+ case 39: /* set foreground color to default */
term.c.attr.fg = defaultfg;
break;
case 48:
if ((idx = tdefcolor(attr, &i, l)) >= 0)
term.c.attr.bg = idx;
break;
- case 49:
+ case 49: /* set background color to default */
term.c.attr.bg = defaultbg;
break;
case 58:
@@ -1826,12 +1826,16 @@ tsetmode(int priv, int set, const int *args, int narg)
case 1006: /* 1006: extended reporting mode */
xsetmode(set, MODE_MOUSESGR);
break;
- case 1034:
+ case 1034: /* 1034: enable 8-bit mode for keyboard input */
xsetmode(set, MODE_8BIT);
break;
case 1049: /* swap screen & set/restore cursor as xterm */
- case 47: /* swap screen */
- case 1047: /*swap screen, clearing alternate screen */
+ if (!allowaltscreen)
+ break;
+ tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
+ /* FALLTHROUGH */
+ case 47: /* swap screen buffer */
+ case 1047: /* swap screen buffer */
if (!allowaltscreen)
break;
if (set)
@@ -1840,10 +1844,8 @@ tsetmode(int priv, int set, const int *args, int narg)
tloaddefscreen(*args == 1047, *args == 1049);
break;
/* FALLTHROUGH */
- case 1048:
- if (!allowaltscreen)
- break;
- tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
+ case 1048: /* save/restore cursor (like DECSC/DECRC) */
+ tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
break;
case 2004: /* 2004: bracketed paste mode */
xsetmode(set, MODE_BRCKTPASTE);
@@ -2107,7 +2109,11 @@ csihandle(void)
tcursor(CURSOR_SAVE);
break;
case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */
- tcursor(CURSOR_LOAD);
+ if (csiescseq.priv) {
+ goto unknown;
+ } else {
+ tcursor(CURSOR_LOAD);
+ }
break;
case ' ':
switch (csiescseq.mode[1]) {
@@ -2246,7 +2252,7 @@ strhandle(void)
fprintf(stderr, "erresc: invalid directory %s\n",
strescseq.args[1]);
return;
- case 52:
+ case 52: /* manipulate selection data */
if (narg > 2 && allowwindowops) {
dec = base64dec(strescseq.args[2]);
if (dec) {
@@ -2257,9 +2263,9 @@ strhandle(void)
}
}
return;
- case 10:
- case 11:
- case 12:
+ case 10: /* set dynamic VT100 text foreground color */
+ case 11: /* set dynamic VT100 text background color */
+ case 12: /* set dynamic text cursor color */
if (narg < 2)
break;
p = strescseq.args[1];
@@ -2300,6 +2306,19 @@ strhandle(void)
tfulldirt();
}
return;
+ case 110: /* reset dynamic VT100 text foreground color */
+ case 111: /* reset dynamic VT100 text background color */
+ case 112: /* reset dynamic text cursor color */
+ if (narg != 1)
+ break;
+ if ((j = par - 110) < 0 || j >= LEN(osc_table))
+ break; /* shouldn't be possible */
+ if (xsetcolorname(osc_table[j].idx, NULL)) {
+ fprintf(stderr, "erresc: %s color not found\n", osc_table[j].str);
+ } else {
+ tfulldirt();
+ }
+ return;
}
break;
case 'k': /* old title set compatibility */