Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FocusGained / FocusLost events sometimes don't fire on mac #16

Open
ddickstein opened this issue Dec 6, 2017 · 5 comments
Open

FocusGained / FocusLost events sometimes don't fire on mac #16

ddickstein opened this issue Dec 6, 2017 · 5 comments

Comments

@ddickstein
Copy link

On Mac OS Sierra in some cases the focus gained / lost events don't fire.

They successfully fire when:

  • I have 2 tmux panes open, one of which is running vim, and I am navigating back and forth between them. Entering the pane running vim triggers FocusGained, and exiting the pane triggers FocusLost.
  • I am running Vim in one window and I open a new tmux window (FocusLost) and then close it (FocusGained).

They fail to fire when:

  • I have only one tmux pane open and I create a new one. I move to the newly created pane but the FocusLost event for the previous pane running vim does not fire.
  • I have two tmux panes open, one of which is running vim, and I am in the other pane. If I close it I return to the pane running vim, but no FocusGained event triggers.

This problem does not seem to occur on Linux.

@ddickstein
Copy link
Author

Update: it seems that the "fail to fire" cases actually do fire but it takes several seconds before they do. How can I reduce / eliminate this delay?

@MartyLake
Copy link

Did you try this already in you .tmux.conf file ? 

# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -sg escape-time 0

@ddickstein
Copy link
Author

Yes

@ddickstein
Copy link
Author

I am now experiencing this issue on Linux, so it's probably not OS-specific.

@seanedwards
Copy link

seanedwards commented Jul 2, 2019

@ddickstein Did you ever figure this out? I'm having this issue now, and there is not much information out there about terminal focus events.

Linux+urxvt

If I do echo -ne "\033]777;focus;on\007" && read in the console, I can see my terminal outputting the ^[[O and ^[[I events the moment the terminal gets/loses focus, but for some reason tmux seems to be delaying the actual pane focus hooks for up to several seconds.

I have also added set -sg escape-time 0 in my tmux.conf

I don't actually think this is a vim-tmux-focus-events issue, for what it's worth. Just wondering if you figured anything out since there's precious little information out there about tmux and terminal focus hooks at all. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants