diff options
author | 2017-06-03 17:43:01 +0000 | |
---|---|---|
committer | 2017-06-03 17:43:01 +0000 | |
commit | 0c1f54eb9bd2b43a80a0220775abddeeb4ed5471 (patch) | |
tree | 5ffb07652048e360e3ea4e4c7757c0cdc4fe6b30 /usr.bin/tmux/input.c | |
parent | ignore blank lines in man(7) next line scope; (diff) | |
download | wireguard-openbsd-0c1f54eb9bd2b43a80a0220775abddeeb4ed5471.tar.xz wireguard-openbsd-0c1f54eb9bd2b43a80a0220775abddeeb4ed5471.zip |
Make set-clipboard a three-state option so tmux itself can ignore the
sequencess.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r-- | usr.bin/tmux/input.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 54eb8607675..7eb4b20f7a8 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $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> @@ -2103,9 +2103,13 @@ input_osc_52(struct window_pane *wp, const char *p) 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++; @@ -2122,11 +2126,10 @@ input_osc_52(struct window_pane *wp, const char *p) 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); } |