diff options
author | 2013-03-25 11:40:40 +0000 | |
---|---|---|
committer | 2013-03-25 11:40:40 +0000 | |
commit | 275c4208eb45ed62b68492476e72bd344558b7e7 (patch) | |
tree | 565e0d0a5a572f6bc7f540a2eef04be35e6f3860 /usr.bin/tmux/control-notify.c | |
parent | Clarify zoom/unzoom, from Romain Francoise. (diff) | |
download | wireguard-openbsd-275c4208eb45ed62b68492476e72bd344558b7e7.tar.xz wireguard-openbsd-275c4208eb45ed62b68492476e72bd344558b7e7.zip |
Write escaped output in control mode rather than hex, from George
Nachman.
Diffstat (limited to 'usr.bin/tmux/control-notify.c')
-rw-r--r-- | usr.bin/tmux/control-notify.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/control-notify.c b/usr.bin/tmux/control-notify.c index b1f5b8fd2b0..ebeddc98522 100644 --- a/usr.bin/tmux/control-notify.c +++ b/usr.bin/tmux/control-notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control-notify.c,v 1.5 2013/03/25 11:38:43 nicm Exp $ */ +/* $OpenBSD: control-notify.c,v 1.6 2013/03/25 11:40:40 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicm@users.sourceforge.net> @@ -46,8 +46,12 @@ control_notify_input(struct client *c, struct window_pane *wp, if (winlink_find_by_window(&c->session->windows, wp->window) != NULL) { message = evbuffer_new(); evbuffer_add_printf(message, "%%output %u ", wp->id); - for (i = 0; i < len; i++) - evbuffer_add_printf(message, "%02hhx", buf[i]); + for (i = 0; i < len; i++) { + if (buf[i] < ' ' || buf[i] == '\\') + evbuffer_add_printf(message, "\\%03o", buf[i]); + else + evbuffer_add_printf(message, "%c", buf[i]); + } control_write_buffer(c, message); evbuffer_free(message); } |