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

@ -29,6 +29,7 @@
#include <time.h>
#include <unistd.h>
#include <util.h>
#include <vis.h>
#include "tmux.h"
@ -408,7 +409,7 @@ void
window_set_name(struct window *w, const char *new_name)
{
free(w->name);
w->name = xstrdup(new_name);
utf8_stravis(&w->name, new_name, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
notify_window("window-renamed", w);
}