summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-11-15 09:53:24 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-11-15 09:53:24 +0000
commit4c8c8c0852d5b2e43d5bf6f84ff2e8d1f14a2379 (patch)
tree84e8f0fa294e93599ec13e6db034f0ce268e4321 /usr.bin/tmux
parent3f3faf10eef23c8c66c62f28b3a2b23633344a01 (diff)
Add copy-pipe-and-cancel, from Artem Fokin.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/tmux.15
-rw-r--r--usr.bin/tmux/window-copy.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 819d5acd68f..7db14f3ee7a 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.513 2016/10/21 13:51:59 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.514 2016/11/15 09:53:23 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -14,7 +14,7 @@
.\" 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: October 21 2016 $
+.Dd $Mdocdate: November 15 2016 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -1032,6 +1032,7 @@ The following commands are supported in copy mode:
.It Li "copy-end-of-line" Ta "D" Ta "C-k"
.It Li "copy-line" Ta "" Ta ""
.It Li "copy-pipe <command>" Ta "" Ta ""
+.It Li "copy-pipe-and-cancel <command>" Ta "" Ta ""
.It Li "copy-selection" Ta "" Ta ""
.It Li "copy-selection-and-cancel" Ta "Enter" Ta "M-w"
.It Li "cursor-down" Ta "j" Ta "Down"
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 9fe8452500b..4fed3ca54b7 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.159 2016/10/13 20:27:27 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.160 2016/11/15 09:53:23 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -63,7 +63,7 @@ static void window_copy_goto_line(struct window_pane *, const char *);
static void window_copy_update_cursor(struct window_pane *, u_int, u_int);
static void window_copy_start_selection(struct window_pane *);
static int window_copy_update_selection(struct window_pane *, int);
-static void *window_copy_get_selection(struct window_pane *, size_t *);
+static void *window_copy_get_selection(struct window_pane *, size_t *);
static void window_copy_copy_buffer(struct window_pane *, const char *,
void *, size_t);
static void window_copy_copy_pipe(struct window_pane *, struct session *,
@@ -761,6 +761,10 @@ window_copy_command(struct window_pane *wp, struct client *c, struct session *s,
} else if (args->argc == 2 && *args->argv[1] != '\0') {
argument = args->argv[1];
if (strcmp(command, "copy-pipe") == 0) {
+ if (s != NULL)
+ window_copy_copy_pipe(wp, s, NULL, argument);
+ }
+ if (strcmp(command, "copy-pipe-and-cancel") == 0) {
if (s != NULL) {
window_copy_copy_pipe(wp, s, NULL, argument);
window_pane_reset_mode(wp);