summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDOGMAN <dogman@aaathats3as.com>2024-04-03 19:48:11 +0200
committerRafael Marçalo <raroma09@gmail.com>2024-04-07 20:55:26 +0100
commit2b2a11e642b0d79b538730ff5cb9a68363f4fa92 (patch)
tree135b841ed80c18d3ee1b90abde6c4af2d607d830
parentc2a8459e2260b96b9abad59c9ed9c894d2881fa3 (diff)
Reset title when an empty title string is given
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.
-rw-r--r--x.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/x.c b/x.c
index 90edc8d..1e81761 100644
--- a/x.c
+++ b/x.c
@@ -1746,6 +1746,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;
@@ -1760,6 +1763,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;