aboutsummaryrefslogtreecommitdiff
path: root/window-copy.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-05-18 20:24:29 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-05-18 20:24:29 +0000
commit96e7f33da3078facc504c6c66d42956bc44b2e54 (patch)
treeca4c6e2cabdc24c01120f551081399abfc92baf7 /window-copy.c
parent58908fd8c54a3c8d2878a7c6f9ca566093302f92 (diff)
downloadrtmux-96e7f33da3078facc504c6c66d42956bc44b2e54.tar.gz
rtmux-96e7f33da3078facc504c6c66d42956bc44b2e54.tar.bz2
rtmux-96e7f33da3078facc504c6c66d42956bc44b2e54.zip
Support setting the xterm clipboard when copying from copy mode using
the xterm escape sequence for the purpose (if xterm is configured to allow it). Written by and much discussed Ailin Nemui, guidance on xterm/termcap/terminfo from Thomas Dickey.
Diffstat (limited to 'window-copy.c')
-rw-r--r--window-copy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/window-copy.c b/window-copy.c
index 4ee3c3e3..1c060dc0 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1345,6 +1345,9 @@ window_copy_copy_selection(struct window_pane *wp)
}
off--; /* remove final \n */
+ if (options_get_number(&global_options, "set-clipboard"))
+ screen_write_setselection(&wp->ictx.ctx, buf, off);
+
/* Add the buffer to the stack. */
limit = options_get_number(&global_options, "buffer-limit");
paste_add(&global_buffers, buf, off, limit);