mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-12 00:48:53 +01:00
Expand formats in copy-pipe command, suggested by Suraj N Kurapati.
This commit is contained in:
parent
8f1302282b
commit
4429941668
@ -1482,15 +1482,25 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
|
|||||||
void *buf;
|
void *buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct job *job;
|
struct job *job;
|
||||||
|
struct format_tree *ft;
|
||||||
|
char *expanded;
|
||||||
|
|
||||||
buf = window_copy_get_selection(wp, &len);
|
buf = window_copy_get_selection(wp, &len);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return;
|
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);
|
bufferevent_write(job->event, buf, len);
|
||||||
|
|
||||||
|
free(expanded);
|
||||||
|
format_free(ft);
|
||||||
|
|
||||||
window_copy_copy_buffer(wp, bufname, buf, len);
|
window_copy_copy_buffer(wp, bufname, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user