diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-11-12 21:58:05 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-11-12 21:58:05 +0000 |
commit | bd803e82e96512473036461ec3832c569768e535 (patch) | |
tree | 85c0c8298e962531d2f3df4b65c150731c425d87 /window-copy.c | |
parent | fc05bf255af2a39a8168320455f79e7e6d9e915a (diff) | |
parent | f9308bc244bb568fb678effbbb08f8fb277e7560 (diff) | |
download | rtmux-bd803e82e96512473036461ec3832c569768e535.tar.gz rtmux-bd803e82e96512473036461ec3832c569768e535.tar.bz2 rtmux-bd803e82e96512473036461ec3832c569768e535.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/window-copy.c b/window-copy.c index 01b98241..f5973322 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1479,18 +1479,28 @@ void window_copy_copy_pipe(struct window_pane *wp, struct session *sess, const char *bufname, const char *arg) { - void *buf; - size_t len; - struct job *job; - + void *buf; + size_t len; + struct job *job; + struct format_tree *ft; + char *expanded; buf = window_copy_get_selection(wp, &len); if (buf == NULL) return; - job = job_run(arg, sess, NULL, NULL, NULL); + ft = format_create(); + format_window_pane(ft, wp); + if (sess != NULL) + format_session(ft, sess); + expanded = format_expand(ft, arg); + + job = job_run(expanded, sess, NULL, NULL, NULL); bufferevent_write(job->event, buf, len); + free(expanded); + format_free(ft); + window_copy_copy_buffer(wp, bufname, buf, len); } |