diff options
-rw-r--r-- | usr.bin/tmux/cmd-copy-mode.c | 7 | ||||
-rw-r--r-- | usr.bin/tmux/key-bindings.c | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c index 0fa1f655558..0916be98aeb 100644 --- a/usr.bin/tmux/cmd-copy-mode.c +++ b/usr.bin/tmux/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-copy-mode.c,v 1.19 2015/04/19 21:34:21 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.20 2015/04/21 15:34:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -68,8 +68,11 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_NORMAL); window_copy_init_from_pane(wp); } - if (args_has(args, 'M')) + if (args_has(args, 'M')) { + if (wp->mode != NULL && wp->mode != &window_copy_mode) + return (CMD_RETURN_NORMAL); window_copy_start_drag(c, &cmdq->item->mouse); + } if (wp->mode == &window_copy_mode && args_has(self->args, 'u')) window_copy_pageup(wp); diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c index f5bd3b2d0e0..6c980f61b2d 100644 --- a/usr.bin/tmux/key-bindings.c +++ b/usr.bin/tmux/key-bindings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-bindings.c,v 1.45 2015/04/20 15:34:56 nicm Exp $ */ +/* $OpenBSD: key-bindings.c,v 1.46 2015/04/21 15:34:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -221,7 +221,7 @@ key_bindings_init(void) "bind -n MouseDown1Pane select-pane -t=\\; send-keys -M", "bind -n MouseDrag1Border resize-pane -M", "bind -n MouseDown1Status select-window -t=", - "bind -n MouseDrag1Pane copy-mode -M", + "bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"' 'copy-mode -M'", }; u_int i; struct cmd_list *cmdlist; |