From a7f022f97f3ce4174bb59eba0a51aaaf502fdc2b Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Mon, 21 Mar 2022 16:20:28 +0000 Subject: [PATCH] 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 --- osc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osc.c b/osc.c index 5d04910b..c4d29a5c 100644 --- a/osc.c +++ b/osc.c @@ -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;