Yes, of course, there have to be a negation:
sknaumov@sknaumov-VirtualBox:~/tmux.compile$ git diff HEAD
diff --git a/input-keys.c b/input-keys.c
index 2b30d4b..b39d024 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -223,7 +223,8 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
        }

        if ((m->b & 3) != 1 &&
-           options_get_number(&wp->window->options, "mode-mouse") == 1) {
+           options_get_number(&wp->window->options, "mode-mouse") == 1 &&
+           !(wp->base.mode & ALL_MOUSE_MODES)) {
                if (window_pane_set_mode(wp, &window_copy_mode) == 0) {
                        window_copy_init_from_pane(wp);
                        if (wp->mode->mouse != NULL)

2012/10/26 Sergey Naumov <sknau...@gmail.com>:
> No, I want to enter copy mode when I am in terminal with shell prompt
> (and it is better to have an option to scroll first then move cursor
> when we reached a top of history, because it resembles original mouse
> scrolling in terminal), but I want to use program-implemented mouse
> scrolling in terminal program (and I always can enter copy mode with
> Ctrl-a [, so this logic is not flawed, I think).
> With this aptch applied I can use mouse scrolling within mc and mcedit
> to select files/navigate through code, but when I press Ctrl-o (switch
> to mc internal subshell), I can scroll mouse to enter copy mode and
> look at terminal history.
>
> Sergey Naumov.
>
> 2012/10/26, Nicholas Marriott <nicholas.marri...@gmail.com>:
>> So you want to only enter copy mode when the program has already claimed
>> the mouse? Or am I reading this wrong?
>>
>>
>> On Sun, Sep 30, 2012 at 10:05:00PM +0400, Sergey Naumov wrote:
>>> 2012/9/25 Nicholas Marriott <nicholas.marri...@gmail.com>:
>>> > You can tell by checking whether the program has itself enabled the
>>> > mouse (wp->base.mode & ALL_MOUSE_MODES).
>>>
>>> Yes, this works like a charm (at least in mc and mcedit on xterm):
>>>
>>> sknaumov@sknaumov-VirtualBox:~/tmux.compile$ git diff HEAD
>>> diff --git a/input-keys.c b/input-keys.c
>>> index 2b30d4b..3b049e0 100644
>>> --- a/input-keys.c
>>> +++ b/input-keys.c
>>> @@ -223,7 +223,8 @@ input_mouse(struct window_pane *wp, struct mouse_event
>>> *m)
>>>         }
>>>
>>>         if ((m->b & 3) != 1 &&
>>> -           options_get_number(&wp->window->options, "mode-mouse") == 1)
>>> {
>>> +           options_get_number(&wp->window->options, "mode-mouse") == 1
>>> &&
>>> +           (wp->base.mode & ALL_MOUSE_MODES)) {
>>>                 if (window_pane_set_mode(wp, &window_copy_mode) == 0) {
>>>                         window_copy_init_from_pane(wp);
>>>                         if (wp->mode->mouse != NULL)
>>>
>>> >> Regardless of this feature (which is now in git HEAD) your logic is
>>> >> flawed regarding the circumstances of this -- what if I want to scroll
>>> >> through some program's output, for instance?
>>> >>
>>> >> -- Thomas Adam
>>>
>>> I think that in most cases programs that enable mouse support
>>> scrolling too, but it could be easily done as an option, for example
>>> let's add one more mode: off, copy-mode, on, always-on.
>>> Or, to preserve backward compatibility: off, copy-mode, terminal, on.
>>>
>>> Sergey Naumov.
>>

------------------------------------------------------------------------------
The Windows 8 Center 
In partnership with Sourceforge
Your idea - your app - 30 days. Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to