The branch, master has been updated
       via  48750022c092396e1b9259119fcb9772d6e125f1 (commit)
       via  17bbf90393a5599cfe82becdc5c29a7ad48012c4 (commit)
       via  0d0b3cf9a42f7d9cae2a1c150698a6ed9d9634cf (commit)
      from  ce0b285aad74bae8b7e4d8fff1b63749cf6ddf84 (commit)

- Log -----------------------------------------------------------------
commit 48750022c092396e1b9259119fcb9772d6e125f1
Merge: ce0b285 17bbf90
Author: Thomas Adam <tho...@xteddy.org>
Commit: Thomas Adam <tho...@xteddy.org>

    Merge branch 'obsd-master'
    
    Sync from OpenBSD.

 control-notify.c |   29 +++++++++++++++++++++++++++++
 input.c          |    1 +
 notify.c         |   20 ++++++++++++++++++++
 tmux.h           |    3 +++
 window-copy.c    |    2 +-
 5 files changed, 54 insertions(+), 1 deletions(-)



commit 17bbf90393a5599cfe82becdc5c29a7ad48012c4
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Add notification for input from a pane, from George Nachman.
---
 control-notify.c |   29 +++++++++++++++++++++++++++++
 input.c          |    1 +
 notify.c         |   20 ++++++++++++++++++++
 tmux.h           |    3 +++
 4 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/control-notify.c b/control-notify.c
index 254f1f5..87a25bb 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;
diff --git a/input.c b/input.c
index 7a9f0e4..bc4af1f 100644
--- a/input.c
+++ b/input.c
@@ -752,6 +752,7 @@ input_parse(struct window_pane *wp)
 
        buf = EVBUFFER_DATA(evb);
        len = EVBUFFER_LENGTH(evb);
+       notify_input(wp, evb);
        off = 0;
 
        /* Parse the input. */
diff --git a/notify.c b/notify.c
index 8fe792c..75a16de 100644
--- a/notify.c
+++ b/notify.c
@@ -133,6 +133,26 @@ notify_drain(void)
 }
 
 void
+notify_input(struct window_pane *wp, struct evbuffer *input)
+{
+       struct client   *c;
+       u_int            i;
+
+       /*
+        * notify_input() is not queued and only does anything when
+        * notifications are enabled.
+        */
+       if (!notify_enabled)
+               return;
+
+       for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+               c = ARRAY_ITEM(&clients, i);
+               if (c != NULL && (c->flags & CLIENT_CONTROL))
+                       control_notify_input(c, wp, input);
+       }
+}
+
+void
 notify_window_layout_changed(struct window *w)
 {
        notify_add(NOTIFY_WINDOW_LAYOUT_CHANGED, NULL, NULL, w);
diff --git a/tmux.h b/tmux.h
index b1e1eee..1fbad94 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1531,6 +1531,7 @@ enum mode_key_cmd mode_key_lookup(struct mode_key_data *, 
int);
 /* notify.c */
 void   notify_enable(void);
 void   notify_disable(void);
+void   notify_input(struct window_pane *, struct evbuffer *);
 void   notify_window_layout_changed(struct window *);
 void   notify_window_unlinked(struct session *, struct window *);
 void   notify_window_linked(struct session *, struct window *);
@@ -2224,6 +2225,8 @@ void printflike2 control_write(struct client *, const 
char *, ...);
 void   control_write_buffer(struct client *, struct evbuffer *);
 
 /* control-notify.c */
+void   control_notify_input(struct client *, struct window_pane *,
+           struct evbuffer *);
 void   control_notify_window_layout_changed(struct window *);
 void   control_notify_window_unlinked(struct session *, struct window *);
 void   control_notify_window_linked(struct session *, struct window *);


commit 0d0b3cf9a42f7d9cae2a1c150698a6ed9d9634cf
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Fix search forward so it can match strings on the last line, SF bug
    3571114 from "LiJunLe".
---
 window-copy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/window-copy.c b/window-copy.c
index 2c10861..bed645f 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1068,7 +1068,7 @@ window_copy_search_down(struct window_pane *wp, const 
char *searchstr)
 
 retry:
        sgd = ss.grid;
-       for (i = fy + 1; i < gd->hsize + gd->sy; i++) {
+       for (i = fy + 1; i < gd->hsize + gd->sy + 1; i++) {
                first = 0;
                if (i == fy + 1)
                        first = fx;


-----------------------------------------------------------------------

Summary of changes:
 control-notify.c |   29 +++++++++++++++++++++++++++++
 input.c          |    1 +
 notify.c         |   20 ++++++++++++++++++++
 tmux.h           |    3 +++
 window-copy.c    |    2 +-
 5 files changed, 54 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to