From 8149bc3fa6e93cb083b165a21baa5ec07dd473dc Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 4 Jun 2017 09:02:36 +0000 Subject: 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). --- screen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 087611ae..ebd117a0 100644 --- a/screen.c +++ b/screen.c @@ -21,6 +21,7 @@ #include #include #include +#include #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. */ -- cgit