Re: [hackers] [st][PATCH] Reset title when an empty title string is given

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed, 3 Apr 2024 19:49:57 +0200

On Tue, Apr 02, 2024 at 09:41:15PM -0400, DOGMAN wrote:
> With this patch, st will reset its window title when an empty string is
> given as the terminal title. For example:
> printf "\033]0;\007"
>
> Some applications, like termdown, expect this functionality. xterm
> implements it, but it seems that most other terminal emulators don't.
> In any case, I don't see why there should ever be a case where the st
> window doesn't have a title property.
> ---
> x.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/x.c b/x.c
> index b36fb8c..bd23686 100644
> --- a/x.c
> +++ b/x.c
> _AT_@ -1617,6 +1617,9 @@ xseticontitle(char *p)
> XTextProperty prop;
> DEFAULT(p, opt_title);
>
> + if (p[0] == '\0')
> + p = opt_title;
> +
> if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
> &prop) != Success)
> return;
> _AT_@ -1631,6 +1634,9 @@ xsettitle(char *p)
> XTextProperty prop;
> DEFAULT(p, opt_title);
>
> + if (p[0] == '\0')
> + p = opt_title;
> +
> if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
> &prop) != Success)
> return;
> --
> 2.44.0
>
>

Hi,

Applied, thank you!

-- 
Kind regards,
Hiltjo
Received on Wed Apr 03 2024 - 19:49:57 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 03 2024 - 20:00:38 CEST