aboutsummaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:49:27 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:49:27 +0000
commit7597cb68345d1ff96c34d61f73cbeba1e98484ec (patch)
tree08837490edee14c87a2be7cde2106d7274b7ac72 /screen.c
parent4f2e5f8c50d401b3d57bbf52934bad67475b2b13 (diff)
downloadrtmux-7597cb68345d1ff96c34d61f73cbeba1e98484ec.tar.gz
rtmux-7597cb68345d1ff96c34d61f73cbeba1e98484ec.tar.bz2
rtmux-7597cb68345d1ff96c34d61f73cbeba1e98484ec.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.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/screen.c b/screen.c
index 00bba794..da7763a8 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.82 2009-05-04 17:58:27 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.2 2009/06/03 19:33:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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. */