summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--control.c9
-rw-r--r--tmux.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/control.c b/control.c
index c0d9e812..cb6633ce 100644
--- a/control.c
+++ b/control.c
@@ -79,6 +79,15 @@ control_write(struct client *c, const char *fmt, ...)
server_push_stdout(c);
}
+/* Write a buffer, adding a terminal newline. Empties buffer. */
+void
+control_write_buffer(struct client *c, struct evbuffer *buffer)
+{
+ evbuffer_add_buffer(c->stdout_data, buffer);
+ evbuffer_add(c->stdout_data, "\n", 1);
+ server_push_stdout(c);
+}
+
/* Control input callback. Read lines and fire commands. */
void
control_callback(struct client *c, int closed, unused void *data)
diff --git a/tmux.h b/tmux.h
index 90019bf2..b1e1eeeb 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2221,6 +2221,7 @@ void clear_signals(int);
/* control.c */
void control_callback(struct client *, int, void*);
void printflike2 control_write(struct client *, const char *, ...);
+void control_write_buffer(struct client *, struct evbuffer *);
/* control-notify.c */
void control_notify_window_layout_changed(struct window *);