summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authornicm <nicm>2017-06-04 09:02:36 +0000
committernicm <nicm>2017-06-04 09:02:36 +0000
commit8149bc3fa6e93cb083b165a21baa5ec07dd473dc (patch)
tree1192f61bf7b49276ef6dc1a6c62c6d5d20566036 /screen.c
parentadf5628087829bed2eff635760d7cc456dd1e558 (diff)
Be more strict about escape sequences that rename windows or set titles:
ignore any that not valid UTF-8 outright, and for good measure pass the result through our UTF-8-aware vis(3).
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 087611ae..ebd117a0 100644
--- a/screen.c
+++ b/screen.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <vis.h>
#include "tmux.h"
@@ -107,7 +108,7 @@ void
screen_set_title(struct screen *s, const char *title)
{
free(s->title);
- s->title = xstrdup(title);
+ utf8_stravis(&s->title, title, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
}
/* Resize screen. */