From 2faec76afad7f1a2e4096d04d1d894dcfb646cbf Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 3 Jun 2009 19:33:04 +0000 Subject: Pass window titles through vis(1). <0x20 is dropped anyway by the input state machine but top-bit-set nonprintables could cause trouble, and they are neater like this anyway. Suggested by deraadt a few days ago. --- screen.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 4b355115..53b17bce 100644 --- a/screen.c +++ b/screen.c @@ -19,6 +19,7 @@ #include #include +#include #include "tmux.h" @@ -65,8 +66,12 @@ screen_free(struct screen *s) void screen_set_title(struct screen *s, const char *title) { + char tmp[BUFSIZ]; + + strnvis(tmp, title, sizeof tmp, VIS_OCTAL|VIS_TAB|VIS_NL); + xfree(s->title); - s->title = xstrdup(title); + s->title = xstrdup(tmp); } /* Resize screen. */ -- cgit