aboutsummaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-03 19:33:04 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-03 19:33:04 +0000
commit2faec76afad7f1a2e4096d04d1d894dcfb646cbf (patch)
tree7ed4e4e47fbd5ebb6a871cc366eac45e991ca716 /screen.c
parent655a1aea6cb6121c57240fee7ea4c85c478865c2 (diff)
downloadrtmux-2faec76afad7f1a2e4096d04d1d894dcfb646cbf.tar.gz
rtmux-2faec76afad7f1a2e4096d04d1d894dcfb646cbf.tar.bz2
rtmux-2faec76afad7f1a2e4096d04d1d894dcfb646cbf.zip
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.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 4b355115..53b17bce 100644
--- a/screen.c
+++ b/screen.c
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <string.h>
+#include <vis.h>
#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. */