osc: add support for OSC l function, for setting the window title

This originated in SunOS and is also supported by xterm as an
alternative to the more commonly used OSC 2 control function.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Miscellaneous
This commit is contained in:
Craig Barnes 2022-03-21 16:20:28 +00:00
parent 1e63dddb89
commit a7f022f97f

7
osc.c
View file

@ -530,6 +530,13 @@ osc_notify(struct terminal *term, char *string)
void
osc_dispatch(struct terminal *term)
{
if (term->vt.osc.idx > 0 && term->vt.osc.data[0] == 'l') {
const char *str = (const char *)term->vt.osc.data;
LOG_DBG("OSC: %.*s (prefix = 'l')", (int)term->vt.osc.idx, str);
term_set_window_title(term, str + 1);
return;
}
unsigned param = 0;
int data_ofs = 0;