summaryrefslogtreecommitdiffstats
path: root/window.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 /window.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 'window.c')
-rw-r--r--window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/window.c b/window.c
index 5fe7c8b8..4b59f205 100644
--- a/window.c
+++ b/window.c
@@ -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);
}