sequencess.
-/* $OpenBSD: input.c,v 1.122 2017/05/28 23:23:40 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.123 2017/06/03 17:43:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
char *end;
size_t len;
u_char *out;
- int outlen;
+ int outlen, state;
struct screen_write_ctx ctx;
+ state = options_get_number(global_options, "set-clipboard");
+ if (state != 2)
+ return;
+
if ((end = strchr(p, ';')) == NULL)
return;
end++;
return;
}
- if (options_get_number(global_options, "set-clipboard")) {
- screen_write_start(&ctx, wp, NULL);
- screen_write_setselection(&ctx, out, outlen);
- screen_write_stop(&ctx);
- }
+ screen_write_start(&ctx, wp, NULL);
+ screen_write_setselection(&ctx, out, outlen);
+ screen_write_stop(&ctx);
+
paste_add(out, outlen);
}
-/* $OpenBSD: options-table.c,v 1.88 2017/05/30 21:44:59 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.89 2017/06/03 17:43:01 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
static const char *options_table_pane_status_list[] = {
"off", "top", "bottom", NULL
};
+static const char *options_table_set_clipboard_list[] = {
+ "off", "external", "on", NULL
+};
/* Top-level options. */
const struct options_table_entry options_table[] = {
},
{ .name = "set-clipboard",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SERVER,
+ .choices = options_table_set_clipboard_list,
.default_num = 1
},
-.\" $OpenBSD: tmux.1,v 1.555 2017/05/30 21:44:59 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.556 2017/06/03 17:43:01 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 30 2017 $
+.Dd $Mdocdate: June 3 2017 $
.Dt TMUX 1
.Os
.Sh NAME
each client.
The default is 100.
.It Xo Ic set-clipboard
-.Op Ic on | off
+.Op Ic on | external | off
.Xc
Attempt to set the terminal clipboard content using the
\ee]52;...\e007
.Xr xterm 1
-escape sequences.
-This option is on by default if there is an
+escape sequences, if there is an
.Em \&Ms
entry in the
.Xr terminfo 5
-description for the client terminal.
+description.
+If set to
+.Ic on ,
+.Nm
+will both accept the escape sequence to create a buffer and attempt to set
+the terminal clipboard.
+If set to
+.Ic external ,
+.Nm
+will attempt to set the terminal clipboard but ignore attempts
+by applications to set
+.Nm
+buffers.
+If
+.Ic off ,
+.Nm
+will neither accept the clipboard escape sequence nor attempt to set the
+clipboard.
+.Pp
Note that this feature needs to be enabled in
.Xr xterm 1
by setting the resource:
-/* $OpenBSD: window-copy.c,v 1.177 2017/05/30 21:44:59 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.178 2017/06/03 17:43:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
{
struct screen_write_ctx ctx;
- if (options_get_number(global_options, "set-clipboard")) {
+ if (options_get_number(global_options, "set-clipboard") != 0) {
screen_write_start(&ctx, wp, NULL);
screen_write_setselection(&ctx, buf, len);
screen_write_stop(&ctx);
if (buf == NULL)
return;
- if (options_get_number(global_options, "set-clipboard")) {
+ if (options_get_number(global_options, "set-clipboard") != 0) {
screen_write_start(&ctx, wp, NULL);
screen_write_setselection(&ctx, buf, len);
screen_write_stop(&ctx);