mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
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.
This commit is contained in:
parent
655a1aea6c
commit
2faec76afa
2 changed files with 7 additions and 2 deletions
7
screen.c
7
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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue