From 7c009509676b4580065fdc6f0084a93b9758fac0 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 11 Mar 2013 15:28:34 +0000 Subject: Don't add prefix to %output pane id. --- control-notify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'control-notify.c') diff --git a/control-notify.c b/control-notify.c index 6bc98b6f..90ee4ffa 100644 --- a/control-notify.c +++ b/control-notify.c @@ -45,7 +45,7 @@ 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); + 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); @@ -141,7 +141,7 @@ control_notify_window_renamed(struct window *w) continue; s = c->session; - control_write(c, "%%window-renamed %u %s", w->id, w->name); + control_write(c, "%%window-renamed %u %s", w->id, w->name); } } @@ -154,7 +154,7 @@ control_notify_attached_session_changed(struct client *c) return; s = c->session; - control_write(c, "%%session-changed %d %s", s->id, s->name); + control_write(c, "%%session-changed %u %s", s->id, s->name); } void -- cgit From 99934bf9988ca364d3d75bb185863eed184a2971 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 12 Mar 2013 22:48:58 +0000 Subject: Write escaped output in control mode rather than hex, from George Nachman. --- control-notify.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'control-notify.c') diff --git a/control-notify.c b/control-notify.c index 90ee4ffa..42c1695b 100644 --- a/control-notify.c +++ b/control-notify.c @@ -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); } -- cgit From 4d38b6d1fab398b0af6d22281d0d4b35448524f7 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 13 Mar 2013 07:28:12 +0000 Subject: Include prefix on ids, from George Nachman. --- control-notify.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'control-notify.c') diff --git a/control-notify.c b/control-notify.c index 42c1695b..0931c23a 100644 --- a/control-notify.c +++ b/control-notify.c @@ -45,7 +45,7 @@ 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); + evbuffer_add_printf(message, "%%output %%%u ", wp->id); for (i = 0; i < len; i++) { if (buf[i] < ' ' || buf[i] == '\\') evbuffer_add_printf(message, "\\%03o", buf[i]); @@ -108,7 +108,7 @@ control_notify_window_unlinked(unused struct session *s, struct window *w) continue; cs = c->session; - control_write(c, "%%window-close %u", w->id); + control_write(c, "%%window-close @%u", w->id); } } @@ -126,9 +126,9 @@ control_notify_window_linked(unused struct session *s, struct window *w) cs = c->session; if (winlink_find_by_window_id(&cs->windows, w->id) != NULL) - control_write(c, "%%window-add %u", w->id); + control_write(c, "%%window-add @%u", w->id); else - control_write(c, "%%unlinked-window-add %u", w->id); + control_write(c, "%%unlinked-window-add @%u", w->id); } } @@ -145,7 +145,7 @@ control_notify_window_renamed(struct window *w) continue; s = c->session; - control_write(c, "%%window-renamed %u %s", w->id, w->name); + control_write(c, "%%window-renamed @%u %s", w->id, w->name); } } @@ -158,7 +158,7 @@ control_notify_attached_session_changed(struct client *c) return; s = c->session; - control_write(c, "%%session-changed %u %s", s->id, s->name); + control_write(c, "%%session-changed $%u %s", s->id, s->name); } void @@ -169,10 +169,10 @@ control_notify_session_renamed(struct session *s) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session != s) + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; - control_write(c, "%%session-renamed %s", s->name); + control_write(c, "%%session-renamed $%u %s", s->id, s->name); } } @@ -184,7 +184,7 @@ control_notify_session_created(unused struct session *s) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; control_write(c, "%%sessions-changed"); @@ -199,7 +199,7 @@ control_notify_session_close(unused struct session *s) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) continue; control_write(c, "%%sessions-changed"); -- cgit