diff options
author | Thomas Adam <thomas@xteddy.org> | 2012-09-25 17:05:36 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2012-09-25 17:05:36 +0100 |
commit | 48750022c092396e1b9259119fcb9772d6e125f1 (patch) | |
tree | 4008645b8d49985039c27316106aa9fed3c36ee9 /control-notify.c | |
parent | ce0b285aad74bae8b7e4d8fff1b63749cf6ddf84 (diff) | |
parent | 17bbf90393a5599cfe82becdc5c29a7ad48012c4 (diff) | |
download | rtmux-48750022c092396e1b9259119fcb9772d6e125f1.tar.gz rtmux-48750022c092396e1b9259119fcb9772d6e125f1.tar.bz2 rtmux-48750022c092396e1b9259119fcb9772d6e125f1.zip |
Merge branch 'obsd-master'
Sync from OpenBSD.
Diffstat (limited to 'control-notify.c')
-rw-r--r-- | control-notify.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/control-notify.c b/control-notify.c index 254f1f58..87a25bb1 100644 --- a/control-notify.c +++ b/control-notify.c @@ -25,6 +25,35 @@ ((c) != NULL && ((c)->flags & CLIENT_CONTROL)) void +control_notify_input(struct client *c, struct window_pane *wp, + struct evbuffer *input) +{ + u_char *buf; + size_t len; + struct evbuffer *message; + u_int i; + + if (c->session == NULL) + return; + + buf = EVBUFFER_DATA(input); + len = EVBUFFER_LENGTH(input); + + /* + * Only write input if the window pane is linked to a window belonging + * to the client's session. + */ + 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]); + control_write_buffer(c, message); + evbuffer_free(message); + } +} + +void control_notify_window_layout_changed(struct window *w) { struct client *c; |