bump version to 0.9.3
https://git.suckless.org/st/commit/5a4666c19e3956069147aee43a06b326d998366e.html add a few comments https://git.suckless.org/st/commit/5a4666c19e3956069147aee43a06b326d998366e.html Support OSC 110, 111, and 112 for resetting colors This adds support for OSC 110, 111, and 112 escape sequences to reset the foreground, background, and cursor colors in the terminal. The changes include handling these sequences in the `strhandle` function of `st.c`, allowing applications to reset colors to their default values. The OSC sequences originated from Xterm control sequences and are now widely used in terminal applications and supported by many terminal emulators. For applications, this allows them to reset colors to default values without needing to know the colors beforehand. https://git.suckless.org/st/commit/d6c431859c6c0201e0668ed24a9f17cebf0a68f5.html
This commit is contained in:
parent
9328548866
commit
bdb21ddb8b
3 changed files with 25 additions and 12 deletions
33
st.c
33
st.c
|
|
@ -1837,7 +1837,7 @@ tsetattr(const int *attr, int l)
|
|||
term.c.attr.fg = idx;
|
||||
#endif // MONOCHROME_PATCH
|
||||
break;
|
||||
case 39:
|
||||
case 39: /* set foreground color to default */
|
||||
term.c.attr.fg = defaultfg;
|
||||
break;
|
||||
case 48:
|
||||
|
|
@ -1848,7 +1848,7 @@ tsetattr(const int *attr, int l)
|
|||
term.c.attr.bg = idx;
|
||||
#endif // MONOCHROME_PATCH
|
||||
break;
|
||||
case 49:
|
||||
case 49: /* set background color to default */
|
||||
term.c.attr.bg = defaultbg;
|
||||
break;
|
||||
#if UNDERCURL_PATCH
|
||||
|
|
@ -1985,7 +1985,7 @@ 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 */
|
||||
|
|
@ -1993,8 +1993,8 @@ tsetmode(int priv, int set, const int *args, int narg)
|
|||
break;
|
||||
tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
|
||||
/* FALLTHROUGH */
|
||||
case 47: /* swap screen */
|
||||
case 1047:
|
||||
case 47: /* swap screen buffer */
|
||||
case 1047: /* swap screen buffer */
|
||||
if (!allowaltscreen)
|
||||
break;
|
||||
#if REFLOW_PATCH
|
||||
|
|
@ -2018,7 +2018,7 @@ tsetmode(int priv, int set, const int *args, int narg)
|
|||
break;
|
||||
/* FALLTHROUGH */
|
||||
#endif // REFLOW_PATCH
|
||||
case 1048:
|
||||
case 1048: /* save/restore cursor (like DECSC/DECRC) */
|
||||
#if REFLOW_PATCH
|
||||
if (!allowaltscreen)
|
||||
break;
|
||||
|
|
@ -2656,7 +2656,7 @@ strhandle(void)
|
|||
xsettitle(strescseq.args[1]);
|
||||
#endif // CSI_22_23_PATCH
|
||||
return;
|
||||
case 52:
|
||||
case 52: /* manipulate selection data */
|
||||
if (narg > 2 && allowwindowops) {
|
||||
dec = base64dec(strescseq.args[2]);
|
||||
if (dec) {
|
||||
|
|
@ -2674,9 +2674,9 @@ strhandle(void)
|
|||
#endif // OSC7_PATCH
|
||||
case 8: /* Clear Hyperlinks */
|
||||
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];
|
||||
|
|
@ -2717,6 +2717,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;
|
||||
#if OSC133_PATCH
|
||||
case 133:
|
||||
if (narg < 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue