diff options
| author | DOGMAN <dogman@aaathats3as.com> | 2024-04-03 19:48:11 +0200 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2024-04-03 19:49:05 +0200 |
| commit | 497a75638291454875ba1ec8d484c7f3d6f41d66 (patch) | |
| tree | d1df0d8f57fd4af2a69664f9861d9c318671f015 | |
| parent | Revert "Fix cursor move with wide glyphs" (diff) | |
| download | st-497a75638291454875ba1ec8d484c7f3d6f41d66.tar.gz st-497a75638291454875ba1ec8d484c7f3d6f41d66.zip | |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -1617,6 +1617,9 @@ xseticontitle(char *p) | |||
| 1617 | XTextProperty prop; | 1617 | XTextProperty prop; |
| 1618 | DEFAULT(p, opt_title); | 1618 | DEFAULT(p, opt_title); |
| 1619 | 1619 | ||
| 1620 | if (p[0] == '\0') | ||
| 1621 | p = opt_title; | ||
| 1622 | |||
| 1620 | if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, | 1623 | if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, |
| 1621 | &prop) != Success) | 1624 | &prop) != Success) |
| 1622 | return; | 1625 | return; |
| @@ -1631,6 +1634,9 @@ xsettitle(char *p) | |||
| 1631 | XTextProperty prop; | 1634 | XTextProperty prop; |
| 1632 | DEFAULT(p, opt_title); | 1635 | DEFAULT(p, opt_title); |
| 1633 | 1636 | ||
| 1637 | if (p[0] == '\0') | ||
| 1638 | p = opt_title; | ||
| 1639 | |||
| 1634 | if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, | 1640 | if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, |
| 1635 | &prop) != Success) | 1641 | &prop) != Success) |
| 1636 | return; | 1642 | return; |
