Skip to content

Commit

Permalink
Reset title when an empty title string is given
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DOGMAN authored and hiltjo committed Apr 3, 2024
1 parent 8c68ec5 commit 497a756
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 497a756

Please sign in to comment.