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 | |
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.
-rw-r--r-- | input.c | 2 | ||||
-rw-r--r-- | screen.c | 7 |
2 files changed, 7 insertions, 2 deletions
@@ -475,7 +475,7 @@ input_state_string_next(u_char ch, struct input_ctx *ictx) return; } - if (ch >= 0x20 && ch != 0x7f) { + if (ch >= 0x20) { if (input_add_string(ictx, ch) != 0) input_state(ictx, input_state_first); return; @@ -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. */ |