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). --- window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index 5fe7c8b8..4b59f205 100644 --- a/window.c +++ b/window.c @@ -29,6 +29,7 @@ #include #include #include +#include #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); } -- cgit