aboutsummaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
authornicm <nicm>2020-02-03 13:46:27 +0000
committernicm <nicm>2020-02-03 13:46:27 +0000
commit265164d251f427bf9275c355a4f205c781d70b20 (patch)
tree9ddc4dee575a2d99de8347a5407dcc9a45d4b305 /screen.c
parent87bcc0c7e0fa0aded9a05093caaf22f3a080753d (diff)
downloadrtmux-265164d251f427bf9275c355a4f205c781d70b20.tar.gz
rtmux-265164d251f427bf9275c355a4f205c781d70b20.tar.bz2
rtmux-265164d251f427bf9275c355a4f205c781d70b20.zip
Instead of passing titles through vis() which doubles backslashes, just
ignore any containing control characters or invalid UTF-8. GitHub issue 2070.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/screen.c b/screen.c
index 9db0f609..5aa30271 100644
--- a/screen.c
+++ b/screen.c
@@ -152,11 +152,16 @@ screen_set_cursor_colour(struct screen *s, const char *colour)
}
/* Set screen title. */
-void
+int
screen_set_title(struct screen *s, const char *title)
{
+ char *cp;
+
+ if (!utf8_isvalid(title))
+ return (0);
free(s->title);
- utf8_stravis(&s->title, title, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
+ s->title = xstrdup(title);
+ return (1);
}
/* Set screen path. */