summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd-set-window-option.c3
-rw-r--r--tmux.112
-rw-r--r--tmux.c5
-rw-r--r--window-choose.c5
-rw-r--r--window-copy.c5
5 files changed, 20 insertions, 10 deletions
diff --git a/cmd-set-window-option.c b/cmd-set-window-option.c
index ce83fb4f..ec10c79d 100644
--- a/cmd-set-window-option.c
+++ b/cmd-set-window-option.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-set-window-option.c,v 1.35 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-set-window-option.c,v 1.36 2009-07-30 20:32:05 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -60,6 +60,7 @@ const struct set_option_entry set_window_option_table[] = {
{ "mode-bg", SET_OPTION_COLOUR, 0, 0, NULL },
{ "mode-fg", SET_OPTION_COLOUR, 0, 0, NULL },
{ "mode-keys", SET_OPTION_CHOICE, 0, 0, set_option_mode_keys_list },
+ { "mode-mouse", SET_OPTION_FLAG, 0, 0, NULL },
{ "monitor-activity", SET_OPTION_FLAG, 0, 0, NULL },
{ "monitor-content", SET_OPTION_STRING, 0, 0, NULL },
{ "remain-on-exit", SET_OPTION_FLAG, 0, 0, NULL },
diff --git a/tmux.1 b/tmux.1
index 453dee5b..9bb3368c 100644
--- a/tmux.1
+++ b/tmux.1
@@ -1,4 +1,4 @@
-.\" $Id: tmux.1,v 1.135 2009-07-28 23:19:06 tcunha Exp $
+.\" $Id: tmux.1,v 1.136 2009-07-30 20:32:05 tcunha Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -1529,9 +1529,15 @@ Set window modes foreground colour.
.It Xo Ic mode-keys
.Op Ic vi | Ic emacs
.Xc
-Use vi or emacs-style
-key bindings in scroll and copy modes.
+Use vi or emacs-style key bindings in scroll, copy and choice modes.
Key bindings default to emacs.
+.It Xo Ic mode-mouse
+.Op Ic on | Ic off
+.Xc
+Mouse state in modes. If on,
+.Nm
+will respond to mouse clicks by moving the cursor in copy mode or selecting an
+option in choice mode.
.It Xo Ic monitor-activity
.Op Ic on | Ic off
.Xc
diff --git a/tmux.c b/tmux.c
index b20e36b4..b867a6fd 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.152 2009-07-30 20:21:55 tcunha Exp $ */
+/* $Id: tmux.c,v 1.153 2009-07-30 20:32:05 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -387,12 +387,13 @@ main(int argc, char **argv)
options_set_number(&global_w_options, "clock-mode-style", 1);
options_set_number(&global_w_options, "force-height", 0);
options_set_number(&global_w_options, "force-width", 0);
- options_set_number(&global_w_options, "mode-attr", GRID_ATTR_REVERSE);
options_set_number(&global_w_options, "main-pane-width", 81);
options_set_number(&global_w_options, "main-pane-height", 24);
+ options_set_number(&global_w_options, "mode-attr", GRID_ATTR_REVERSE);
options_set_number(&global_w_options, "mode-bg", 3);
options_set_number(&global_w_options, "mode-fg", 0);
options_set_number(&global_w_options, "mode-keys", MODEKEY_EMACS);
+ options_set_number(&global_w_options, "mode-mouse", 1);
options_set_number(&global_w_options, "monitor-activity", 0);
options_set_string(&global_w_options, "monitor-content", "%s", "");
if (flags & IDENTIFY_UTF8)
diff --git a/window-choose.c b/window-choose.c
index 7ee8f1d0..9c6931da 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -1,4 +1,4 @@
-/* $Id: window-choose.c,v 1.20 2009-07-28 23:11:18 tcunha Exp $ */
+/* $Id: window-choose.c,v 1.21 2009-07-30 20:32:05 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -123,7 +123,8 @@ window_choose_init(struct window_pane *wp)
s = &data->screen;
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);
s->mode &= ~MODE_CURSOR;
- s->mode |= MODE_MOUSE;
+ if (options_get_number(&wp->window->options, "mode-mouse"))
+ s->mode |= MODE_MOUSE;
keys = options_get_number(&wp->window->options, "mode-keys");
if (keys == MODEKEY_EMACS)
diff --git a/window-copy.c b/window-copy.c
index 56c41223..58ea727c 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1,4 +1,4 @@
-/* $Id: window-copy.c,v 1.71 2009-07-28 23:11:18 tcunha Exp $ */
+/* $Id: window-copy.c,v 1.72 2009-07-30 20:32:05 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -104,7 +104,8 @@ window_copy_init(struct window_pane *wp)
s = &data->screen;
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);
- s->mode |= MODE_MOUSE;
+ if (options_get_number(&wp->window->options, "mode-mouse"))
+ s->mode |= MODE_MOUSE;
keys = options_get_number(&wp->window->options, "mode-keys");
if (keys == MODEKEY_EMACS)