Re: native xterm scrolling with mouse

2012-11-28 Thread Sergey Naumov
I have pulled the last changes from tmux repo and tested it on xubuntu 12.10. Copy-mode entrance and exit works as it should in case of copy-mode=on. Two mounths ago (last commit was dated 27 september) it doesn't (mc even with -x option didn't react on mouse wheel without my patch). By the way, sc

Re: native xterm scrolling with mouse

2012-11-27 Thread Thomas Adam
Hi, On 28 November 2012 07:02, Sergey Naumov wrote: > I can't check it right now at work because build on Debian Squeeze is broken: > > control.c: In function ‘control_callback’: > control.c:103: warning: implicit declaration of function ‘evbuffer_readln’ > control.c:103: warning: nested extern d

Re: native xterm scrolling with mouse

2012-11-27 Thread Sergey Naumov
I can't check it right now at work because build on Debian Squeeze is broken: control.c: In function ‘control_callback’: control.c:103: warning: implicit declaration of function ‘evbuffer_readln’ control.c:103: warning: nested extern declaration of ‘evbuffer_readln’ control.c:103: error: ‘EVBUFFER

Re: native xterm scrolling with mouse

2012-11-27 Thread Nicholas Marriott
Actually, I've reverted this. When I use "mode-mouse on" with applications inside that claim the mouse (easiest example is another tmux server with mouse-select-pane and the window split) it works fine. Do I misunderstand what you are trying to fix? On Tue, Nov 27, 2012 at 02:23:03PM +, Nich

Re: native xterm scrolling with mouse

2012-11-27 Thread Nicholas Marriott
Applied, thnaks. On Fri, Oct 26, 2012 at 08:09:17PM +0400, Sergey Naumov wrote: > 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/inpu

Re: native xterm scrolling with mouse

2012-10-26 Thread Sergey Naumov
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)

Re: native xterm scrolling with mouse

2012-10-26 Thread Sergey Naumov
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

Re: native xterm scrolling with mouse

2012-10-26 Thread Nicholas Marriott
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 : > > You can tell by checking whether the program has itself enabled the > > mouse (wp->bas

Re: native xterm scrolling with mouse

2012-09-30 Thread Sergey Naumov
2012/9/25 Nicholas Marriott : > 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/

Re: native xterm scrolling with mouse

2012-09-30 Thread Sergey Naumov
I have just pulled, compiled and installed the latest tmux and can't see any changes. Could you tell me a commit hash? There is also no new option to select desired behavior: sknaumov@sknaumov-VirtualBox:~/tmux.compile$ git remote -v origin git://tmux.git.sourceforge.net/gitroot/tmux/tmux (fetch

Re: native xterm scrolling with mouse

2012-09-24 Thread Nicholas Marriott
You can tell by checking whether the program has itself enabled the mouse (wp->base.mode & ALL_MOUSE_MODES). On Mon, Sep 24, 2012 at 10:56:17PM +0100, Thomas Adam wrote: > On 24 September 2012 20:57, Sergey Naumov wrote: > > At weekends I will try to research how to determine that we are in a >

Re: native xterm scrolling with mouse

2012-09-24 Thread Thomas Adam
On 24 September 2012 20:57, Sergey Naumov wrote: > At weekends I will try to research how to determine that we are in a > "real" terminal, not in a terminal program like mc or vim. Then it > will be possible to automatically enter copy mode at the "real" > terminal, but use mouse as usual in termi

Re: native xterm scrolling with mouse

2012-09-24 Thread Thomas Adam
On 24 September 2012 21:24, Sergey Naumov wrote: > This version should work better - just like in mc and mcedit. > Haven't checked whether screen_size_y(s) - 1 is still valid if there > is no statusbar, but idea is clear. I synced git HEAD earlier -- that should contain a patch like this. -- Tho

Re: native xterm scrolling with mouse

2012-09-24 Thread Sergey Naumov
This version should work better - just like in mc and mcedit. Haven't checked whether screen_size_y(s) - 1 is still valid if there is no statusbar, but idea is clear. Sergey Naumov. 2012/9/24 Sergey Naumov : > 2012/9/24 Thomas Adam : >> On 23 September 2012 20:56, Sergey Naumov wrote: >>> Also,

Re: native xterm scrolling with mouse

2012-09-24 Thread Sergey Naumov
2012/9/24 Thomas Adam : > On 23 September 2012 20:56, Sergey Naumov wrote: >> Also, could you explain how to detect if there is a up/down space >> outside visible area we can scroll to? I have surfed the code a bit a >> have tried screen->grid->hsize, because screen_resize_y() uses it to >> check

Re: native xterm scrolling with mouse

2012-09-23 Thread Thomas Adam
On 23 September 2012 20:56, Sergey Naumov wrote: > Also, could you explain how to detect if there is a up/down space > outside visible area we can scroll to? I have surfed the code a bit a > have tried screen->grid->hsize, because screen_resize_y() uses it to > check if there is some lines to pul

Re: native xterm scrolling with mouse

2012-09-23 Thread Sergey Naumov
Thomas, how do you think, is there a way to detect if we are in terminal or in program that is running in terminal? May be by raw mode or something else? Entering to scroll mode automatically by mouse wheel is very convenient in terminal, but it breaks mouse behavior for terminal programs. May be

Re: native xterm scrolling with mouse

2012-09-23 Thread Sergey Naumov
> Run mc as: > > mc -x Thanks, it works! By the way, I suggest you consider to make tmux scrolling to behave like mcedit's one (at least optional): scroll first (preserving relational cursor position) and if we are at the top, then move cursor up. Imagine that you use terminal and want to scroll

Re: native xterm scrolling with mouse

2012-09-23 Thread Thomas Adam
On Sun, Sep 23, 2012 at 04:03:43PM +0400, Sergey Naumov wrote: > 2012/9/19 Thomas Adam : > > On Wed, Sep 19, 2012 at 09:19:35PM +0400, Sergey Naumov wrote: > >> 2012/9/19 Thomas Adam : > >> > On Wed, Sep 19, 2012 at 01:37:59PM +0400, Sergey Naumov wrote: > >> >> Is it possible to enable native xter

Re: native xterm scrolling with mouse

2012-09-23 Thread Sergey Naumov
2012/9/19 Thomas Adam : > On Wed, Sep 19, 2012 at 09:19:35PM +0400, Sergey Naumov wrote: >> 2012/9/19 Thomas Adam : >> > On Wed, Sep 19, 2012 at 01:37:59PM +0400, Sergey Naumov wrote: >> >> Is it possible to enable native xterm mouse scrolling while in tmux? >> >> What I actually want is to use xte

Re: native xterm scrolling with mouse

2012-09-19 Thread Thomas Adam
On Wed, Sep 19, 2012 at 09:19:35PM +0400, Sergey Naumov wrote: > 2012/9/19 Thomas Adam : > > On Wed, Sep 19, 2012 at 01:37:59PM +0400, Sergey Naumov wrote: > >> Is it possible to enable native xterm mouse scrolling while in tmux? > >> What I actually want is to use xterm mouse scrolling by default

Re: native xterm scrolling with mouse

2012-09-19 Thread Sergey Naumov
2012/9/19 Thomas Adam : > On Wed, Sep 19, 2012 at 01:37:59PM +0400, Sergey Naumov wrote: >> Is it possible to enable native xterm mouse scrolling while in tmux? >> What I actually want is to use xterm mouse scrolling by default and >> use mouse in tmux-like way only when I have entered to copy-mode

Re: native xterm scrolling with mouse

2012-09-19 Thread Thomas Adam
On Wed, Sep 19, 2012 at 01:37:59PM +0400, Sergey Naumov wrote: > Is it possible to enable native xterm mouse scrolling while in tmux? > What I actually want is to use xterm mouse scrolling by default and > use mouse in tmux-like way only when I have entered to copy-mode by > keyboard shortcut. Don

native xterm scrolling with mouse

2012-09-19 Thread Sergey Naumov
Hello. I have decided to try tmux as GNU screen replacement and wonder if there is a way to scroll with mouse as in xterm? It is possible to enable native xterm scrolling with Shift + PageUp in tmux by set -g terminal-overrides 'xterm*:smcup@:rmcup@' But this does not work for mouse. I have opt