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).
This commit is contained in:
nicm
2017-06-04 09:02:36 +00:00
parent adf5628087
commit 8149bc3fa6
5 changed files with 39 additions and 6 deletions

View File

@ -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. */