sjl / vitality.vim

Make Vim play nicely with iTerm 2 and tmux.
http://github.com/sjl/vitality.vim
MIT License
320 stars 30 forks source link

FocusLost not working #21

Open friolz opened 11 years ago

friolz commented 11 years ago

I've installed vitality.vim and I can see that it's working as far as the cursor bar is concerned. However the file is not saved when I switch away from my iTerm.

Am I doing something wrong?

npearson72 commented 11 years ago

Same thing for me.

gnur commented 10 years ago

It isn't working for me either. Perhaps newer versions of iTerm (I'm on Build 1.0.0.20131228) or OS X (I'm on Mavericks) changed something somehow? I would love this plugin to work because it would really speed up my workflow :)

wincent commented 10 years ago

I'm not using vitality.vim, but rather some hand-rolled stuff borrowed from it. I've also seen that the technique stopped working when inside a tmux session, although it does work outside of tmux and I haven't been able to isolate the responsible variable (could be Mavericks, or tmux 1.9a, or a new version of iTerm).

wincent commented 10 years ago

Looks like it's a regression in tmux. I just switched from 1.9a back to 1.8 and things work again.

I'll see if I can file an upstream bug report or perhaps bisect it to a specific commit.

wincent commented 10 years ago

I bisected it down to commit c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa in the tmux repo. It turns out there's a new focus-events option in 1.9 that defaults to off. You just have to turn it back on with:

  set -g focus-events on

in your ~/.tmux.conf.

keith commented 10 years ago
set -g focus-events on

Works for me thanks!

justmytwospence commented 10 years ago

set -g focus-events on doesn't seem to work for me. iTerm Build 1.0.0.20140629 and tmux stable 1.9a.

leonschreuder commented 9 years ago

It works! But only after I've closed all tmux sessions (just a new session didn't do the trick) and exited iTerm2 completely. Thanks a lot!

gee-forr commented 9 years ago

FYI - I issued a pull request to add some documentation about this. Please see #30