summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-05-18 20:24:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-05-18 20:24:30 +0000
commit65755dfdf50fb4fa4e6f2d3266e6b50684b61cb8 (patch)
tree9607bb464226eea531a1da2067c23185dcb71c0b /usr.bin/tmux/window-copy.c
parentdff18a09b316c82288012f7c1f127896df9d048c (diff)
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 'usr.bin/tmux/window-copy.c')
-rw-r--r--usr.bin/tmux/window-copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 26f82505400..adfea5e45e5 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.71 2011/05/18 18:06:36 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.72 2011/05/18 20:24:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);