-
Notifications
You must be signed in to change notification settings - Fork 23
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
Focus Events Not Firing #1
Comments
Hi, I think the issue might be in step 2. You're doing this See this comment from the guy that had a similar issue in vitality.vim plugin. Let me know the result! |
I'm having the same problem in NeoVim/iTerm on mac. I have tmux 1.9a |
Hey, Can you please try vanilla vim? |
Just to clarify, I do have Perhaps another of my vim/tmux plugins/options is conflicting and preventing the plugin from working? |
@bruno- oops I missed that note about it not working in NeoVim. |
@Morley93, what is the result of running this in vim's command line:
The output should look like this for F24 and F25 respectively
|
I also tried the same procedure as @Morley93 and I couldn't get the focus events to fire. I'm also using tmux 1.9a, but I'm on OSX using Terminal.app. |
Hey guys,
Hopefully the above steps help, let me know if you get stuck at any point. |
Thanks for the input @bruno-, I can confirm that all of the steps you provided are working as described when I have In my initial testing, I was expecting the event to fire when changing focus between different windows in my window manager. For instance:
Is this functionality not supported? |
Hi @Morley93, About the question "I was expecting the event to fire when changing focus between different windows in my window manager": yea, I see how that would be very useful. I think this might be dependent on the terminal application you're using. I just tested this on OSX and here's some quick results:
From what I know iTerm has a very good integration with Tmux so I think that's why the first case is woking. So, if I'm not wrong, it's up to terminal applications to implement "focus gained", "focus lost" functionality. Please correct me if someone has more knowledge about this.. |
I've opened a pull request to add support for focus events in neovim (neovim/neovim#3488). I'd be grateful to anyone willing to give this a test :) |
@expipiplus1 i use neovim. Thanks you very much |
Hi @expipiplus1, |
Hi @bruno-, |
@pyrohh within terminal you use? |
I'm pretty sure that message is to be expected, as long as it happens immediately after |
@pyrohh, please open a PR for the readme update. |
@bruno-, sure thing, I just opened one. |
Can the readme be updated to either remove the line or just change it to say "not needed with Neovim" instead of "not working"? |
It also does not work for switching native windows in gnome-terminal but xterm handles it perfectly. |
I'm getting stuck at Step 3, It doesn't output anything. I'm on Sierra with Terminal 2.7.1 (380). I've also tried iTerm 2 (3.0.10). I'm using tmux 2.2. Vim 8.0 2016 Sep 12; patches 1-3 included. I also had tried this on a recent version of Vim 7.4 and saw the same problem. |
Okay so this is weird. If I:
There's no output of 'foo'. But... if before step 3 I run |
Figured it out! I started commenting out everything in my vimrc and it started working. Turns out I was calling Edit: |
Sorry to necro. re: Step 2 , I do not have I'm using vim-plug to install the plugin. I have tried uninstalling and reinstalling. Is the plugin supposed to set those bindings? Setup: |
Yes. It looks like vim-tmux-focus-events sets bindings for F24/F25. I don't know how to help you specifically but I can point you to my dotfiles which work out of the box on a new Mac (hopefully it'll help you with CentOS). The commit where I added this plugin is f463e37b4. I think that includes everything needed; and most of it is just tweaks for enable/disbling my relative number stuff which you can ignore. (I'm also using vim-diminactive which dims vim on focus lost.) Tmux 2.9a |
@ericboehs Thank you for the speedy response! I'll take a look :) |
Focus events work by default in Neovim, so I'm not sure why one would use this plugin there. |
I recently installed this plugin and can't get it to trigger focus events as advertised. My installation was performed using the Plug plugin manager as specified on the readme. I have put
set -g focus-events on
into mytmux.conf
file and made sure it is sourced prior to testing. I have also tried setting tmux focus events manually as an ex command as described in the reproduction steps. Additionally, I have tried using my preferred terminal emulator (urxvt) with the same result.Details
OS: Arch Linux
vim version: 7.4 (up to date from Arch Linux gvim package at the time of posting, configuration attached).
tmux version: 1.9a
Gnome terminal version: 3.14.2-1
Steps to reproduce
:set -g focus-events on
Expected behaviour: Vim immediately gives a notification that the file has changed, prompting to reload it by pressing L.
Actual behaviour: Vim gives no notification that the file has changed.
Thanks in advance for any support on this.
Attachments
The text was updated successfully, but these errors were encountered: