diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-08-11 07:41:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-08-11 07:41:06 +0000 |
commit | 12d9150ead2f3393cfa242b173a46bd8b4a3ae9e (patch) | |
tree | b0c14c63d22251bbbbb94c9d93a565db1a83131a | |
parent | 2e9918f616100a981bcf2fa05b40e9a3ff8bc87b (diff) |
Handle failure to change mode, to avoid dying when switching into copy
mode when already in a different mode. Reported by "Florian".
-rw-r--r-- | usr.bin/tmux/cmd-copy-mode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c index 742c46fd3a0..93fe93aaa9b 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.10 2010/04/06 21:35:44 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.11 2010/08/11 07:41:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -62,7 +62,8 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_ctx *ctx) if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL) return (-1); - window_pane_set_mode(wp, &window_copy_mode); + if (window_pane_set_mode(wp, &window_copy_mode) != 0) + return (0); window_copy_init_from_pane(wp); if (wp->mode == &window_copy_mode && cmd_check_flag(data->chflags, 'u')) window_copy_pageup(wp); |