diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-06-03 19:33:04 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-06-03 19:33:04 +0000 |
commit | 2faec76afad7f1a2e4096d04d1d894dcfb646cbf (patch) | |
tree | 7ed4e4e47fbd5ebb6a871cc366eac45e991ca716 /screen.c | |
parent | 655a1aea6cb6121c57240fee7ea4c85c478865c2 (diff) | |
download | rtmux-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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. */ |