Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
Because until we support it we don't want stray \033[I and and \033[O coming through so we need to turn it off, and we can only send the code to turn it off to terminals we think will support it, ie those with XT. On Thu, Feb 21, 2013 at 12:07:12PM -0800, Aaron Jensen wrote: >I see, so why d

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Aaron Jensen
I see, so why do we want to disable it automatically in this case? — Sent from Mailbox for iPhone On Thu, Feb 21, 2013 at 10:44 AM, Nicholas Marriott wrote: > XT is a terminfo flag which says the terminal "has some xterm features", > tmux uses it as a guide to mean that we can try fancy stuff th

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
Something in your mail system is mangling patches both in and out I guess because mine was fine when it left here and this one is mangled too :-). http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html has some bits about configuring various MUAs (Under "MUA-SPECIFIC HINTS"). Or jus

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
XT is a terminfo flag which says the terminal "has some xterm features", tmux uses it as a guide to mean that we can try fancy stuff that works in xterm and may work elsewhere. We should probably use something else because not may terminfo entries actually have it (including the xterm terminfo its

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
Actually I think this is the wrong approach because there are too many corner cases (you missed out at least attach, detach and linked windows). Please try this instead which just checks the panes at the end of the server loop. I think this will work better when you are listening for the keys in

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Aaron Jensen
Inlline... On Thu, Feb 21, 2013 at 9:28 AM, Nicholas Marriott < nicholas.marri...@gmail.com> wrote: > Ok the session_set_current_winlink idea is good so I have applied that > bit but renamed to session_set_current. > > Here is an updated diff with a few changes: > > - Spacing fixes. Looks like yo

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
Ok the session_set_current_winlink idea is good so I have applied that bit but renamed to session_set_current. Here is an updated diff with a few changes: - Spacing fixes. Looks like your mailer mangles spaces. Can you fix that or send the diffs as an attachment instead? - Renamed window_pane_f

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
Can you please drop the handling of focus events from outside tmux for now and just concentrate on those from inside? It is more complicated than it appears - what if a pane is active in sessions attached to two terminals? I suggest for now tmux explicitly turns this off if XT is present with \033

Re: [PATCH] Added support for Focus Event notification

2013-02-21 Thread Nicholas Marriott
But it will not affect all panes, because tmux should eat the sequence if the application in the pane did not request it. On Wed, Feb 20, 2013 at 11:52:57PM -0800, Aaron Jensen wrote: >On Wednesday, February 20, 2013 at 11:49 PM, Nicholas Marriott wrote: > > Are you telling me that in i

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
On Wednesday, February 20, 2013 at 11:49 PM, Nicholas Marriott wrote: > Are you telling me that in iterm these are on by default? Even if tmux > or the user doesn't ask for them? > > No, sorry I wasn't clear. They are not on by default. You can turn them on the same way you'd turn them on in tm

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Nicholas Marriott
Are you telling me that in iterm these are on by default? Even if tmux or the user doesn't ask for them? On Wed, Feb 20, 2013 at 04:42:01PM -0800, Aaron Jensen wrote: >On Wednesday, February 20, 2013 at 3:56 PM, Aaron Jensen wrote: > > On Wed, Feb 20, 2013 at 3:36 PM, Nicholas Marriot

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
Aleks pinged me and wanted to weigh in directly (CCing to get him on the thread) On Wednesday, February 20, 2013 at 4:42 PM, Aaron Jensen wrote: > > > On Wednesday, February 20, 2013 at 3:56 PM, Aaron Jensen wrote: > > > On Wed, Feb 20, 2013 at 3:36 PM, Nicholas Marriott > > mailto:nichola

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
On Wednesday, February 20, 2013 at 3:56 PM, Aaron Jensen wrote: > On Wed, Feb 20, 2013 at 3:36 PM, Nicholas Marriott > mailto:nicholas.marri...@gmail.com)> wrote: > > I will look at the diff tomorrow, but I don't see why we need an option. > > > > If you enable focusing in your terminal, you'l

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
On Wed, Feb 20, 2013 at 3:36 PM, Nicholas Marriott < nicholas.marri...@gmail.com> wrote: > I will look at the diff tomorrow, but I don't see why we need an option. > > If you enable focusing in your terminal, you'll get it in tmux (if the > application has turned it on). That's what you want, righ

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Nicholas Marriott
I will look at the diff tomorrow, but I don't see why we need an option. If you enable focusing in your terminal, you'll get it in tmux (if the application has turned it on). That's what you want, right? On Wed, Feb 20, 2013 at 07:43:35AM -0800, Aaron Jensen wrote: >On Tuesday, February 19,

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
On Wednesday, February 20, 2013 at 8:21 AM, Aaron Jensen wrote: > Updated patch. Something that is confusing to me is that when I turn the > filter off, something is still preventing ^[[O from getting printed to the > screen. I'm guessing something in tux's input key handling is filtering them >

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
Updated patch. Something that is confusing to me is that when I turn the filter off, something is still preventing ^[[O from getting printed to the screen. I'm guessing something in tux's input key handling is filtering them out? It makes me wonder how I ever saw it and if the filtering is reall

Re: [PATCH] Added support for Focus Event notification

2013-02-20 Thread Aaron Jensen
On Tuesday, February 19, 2013 at 11:53 PM, Aaron Jensen wrote: > 3) I removed the option completely, it's not needed I don't think. > > 4) akracun had added some logic to let panes track their focus status so they > couldn't ever get double notified. It's not a bad idea, but I was worried > that

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Aaron Jensen
Ok, here's a new patch. A few things to note: 1) It probably could use some more testing. I removed the safeguard that prevented the keys to getting through to panes that didn't have focus tracking enabled. In my testing I did see the keys get sent to a pane they shouldn't have though. I'm not

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Aaron Jensen
On Tuesday, February 19, 2013 at 9:52 PM, Aaron Jensen wrote: > On Tuesday, February 19, 2013 at 8:17 AM, Nicholas Marriott wrote: > > > Good question. My guess is that since akracun originally wrote it without > > > the window switching handling he originally envisioned it as a window > > > featur

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Aaron Jensen
On Tuesday, February 19, 2013 at 8:17 AM, Nicholas Marriott wrote: > > Good question. My guess is that since akracun originally wrote it without > > the window switching handling he originally envisioned it as a window > > feature, but I won't put works in his mouth. Now that it handles window > >

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Nicholas Marriott
Actually without -d the focus hasn;t changed, it is still on the same pane, so you won't need to do anything. With -d, you need to unfocus the moved pane and focus the newly focused one in the window it was in. On Tue, Feb 19, 2013 at 04:17:44PM +, Nicholas Marriott wrote: > On Tue, Feb 19,

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Nicholas Marriott
On Tue, Feb 19, 2013 at 07:37:54AM -0800, Aaron Jensen wrote: >Awesome, thanks for the comments. I pinged akracun as well. One of us will >put together a new patch. Questions inline. > >On Tuesday, February 19, 2013 at 1:03 AM, Nicholas Marriott wrote: > >+ window_pane_focus_n

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Aaron Jensen
Awesome, thanks for the comments. I pinged akracun as well. One of us will put together a new patch. Questions inline. On Tuesday, February 19, 2013 at 1:03 AM, Nicholas Marriott wrote: > > + window_pane_focus_notify(w->active, 1); > > > > > We can't apply it with all these little // commen

Re: [PATCH] Added support for Focus Event notification

2013-02-19 Thread Nicholas Marriott
Thanks for the diff. Comments inline. On Mon, Feb 18, 2013 at 05:25:53PM -0800, Aaron Jensen wrote: > From: a > > added focus filtering > > Will send \e[I or \e[O when panes are focused/unfocused. Must be > enabled with the focus-filter window option. > --- > cmd-break-pane.c | 3 +++ > exam

Re: [PATCH] Added support for Focus Event notification

2013-02-18 Thread Aaron Jensen
Most of the work in here was from akracun: https://github.com/akracun/tmux I just added support for window switching and did some refactoring. I'm pretty new to the code base, so let me know if you'd like me to fix anything up. This code is in response to http://sourceforge.net/p/tmux/tickets/

[PATCH] Added support for Focus Event notification

2013-02-18 Thread Aaron Jensen
From: a added focus filtering Will send \e[I or \e[O when panes are focused/unfocused. Must be enabled with the focus-filter window option. --- cmd-break-pane.c | 3 +++ examples/tmux.vim | 2 +- input-keys.c | 10 ++ input.c | 8 options-table.c | 5 +