From 7ed78a31debb0250bae16d8b4098a4689f29bb60 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 12:30:14 +0300 Subject: Take the terminal name from term_options.name The core hard-coded "wsap_term" for XTVERSION, the XTGETTCAP TN and name default, and the OSC 9 notification title. A headless library should take its identity from the host. term_options.name sets the name. NULL or "" selects "term". term_new() copies it and returns NULL unless it is 1 to 63 printable ASCII bytes, since DCS replies echo it. A DCS +p still changes the TN value, and the XTVERSION and notification defaults keep the host name. Co-Authored-By: Claude Haiku 5.5 --- src/escape.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/escape.c') diff --git a/src/escape.c b/src/escape.c index da0449a..dceb7a6 100644 --- a/src/escape.c +++ b/src/escape.c @@ -834,7 +834,9 @@ static inline TERM_ALWAYS_INLINE void dispatch_csi(struct term *t, const struct case 'q': { if (csi->prefix == '>' && !csi->intermediate && (!csi->nparams || !csi->params[0])) { - send_response(t, "\033P>|wsap_term\033\\"); + char resp[96]; + snprintf(resp, sizeof(resp), "\033P>|%s\033\\", t->name); + send_response(t, resp); } else if (!csi->prefix && csi->intermediate == ' ') { term_sc_set_cursor_style(t, csi->nparams > 0 ? csi->params[0] : 0); } -- cgit v1.2.3