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

Conflicts with tmux-plugins/vim-tmux-focus-events #38

Closed
cpixl opened this issue Jul 11, 2015 · 9 comments
Closed

Conflicts with tmux-plugins/vim-tmux-focus-events #38

cpixl opened this issue Jul 11, 2015 · 9 comments
Labels

Comments

@cpixl
Copy link

cpixl commented Jul 11, 2015

Whenever I open an .gpg file, its contents are echoed on the bottom of screen with the 'Press ENTER or type command to continue' message right after.

If I disable the vim-tmux-focus-events plugin or if I set g:GPGUsePipes=1, everything works fine.

Also, my &t_EI and &t_SI settings are being removed by vim-gnupg even without vim-tmux-focus-events. Not sure if this is somewhat related to the same issue.

@jamessan
Copy link
Owner

Both of these are likely items that need to be handled in vim-tmux-focus-events. That being said, I'll try to provide some information on what might be going on.

For the contents echoing at the bottom of the screen, my best guess is that it's an odd interaction with BufReadCmd. As a simple test, you could try these steps and see if you can reproduce similar behavior:

$ vim
:au BufReadCmd .vimrc :exe '0r !cat '.shellescape(expand('<afile>'), 1) | $d _ | exe 'doau BufReadPost '.fnameescape(expand('<afile>'))
:e ~/.vimrc

The t_IE/t_SI behavior is related to #36 (comment). I'd suggest that the vim-tmux-focus-events folks look at the TermChanged autocmd event, since anything that sets 'term' is going to cause the behavior you're seeing. vim-gnupg just has to set 'term' for convoluted reasons.

@cpixl
Copy link
Author

cpixl commented Jul 12, 2015

Hmmmm, tried the suggested steps and it worked without issues... no echoing on the bottom of screen.

Just to make things clear (maybe I didn't understand correctly, but anyway), the &t_IE and &t_SI being unset is not related to the vim-tmux-focus-events plugin, as it happens even when your plugin is the only one on my vimrc.

@jamessan
Copy link
Owner

Yes, the t_IE/t_SI issues are because vim-gnupg has the line let &term=&term, for the reasons described in #36 (comment). However, vim-gnupg also emits the TermChanged autocmd event when this happens.

Even without vim-gnupg, if anything changed the value of 'term', then vim-tmux-focus-events would be broken because it isn't listening for TermChanged and setting up t_IE/t_SI again. That vim-gnupg has to set 'term' is a comedy of errors, but that doesn't change the fact that anyone changing 'term' is going to break the tmux plugin.

@cpixl
Copy link
Author

cpixl commented Jul 12, 2015

Got it! Well, I was setting t_IE and t_SI on my vimrc manually, so I just au TermChanged * and it works fine now! Thank you!

About the echoing in the bottom of screen, the issue persists... and as you suggested the test with BufReadCmd didn't replicate the behavior. Any idea?

@jamessan
Copy link
Owner

Not off-hand. I'll try to find some time to look into that soon.

@bruno-
Copy link

bruno- commented Sep 29, 2015

Hi, I started using this plugin - great stuff!

I also get Press ENTER or type command to continue message at the bottom when opening encrypted file. I also use vim-tmux-focus-events plugin.

I investigated the issue and it seems it starts happening with this commit bd3ebdf. I further confirmed this by commenting out this let &term = &term around line 1295 in plugin/gnupg.vim. When this is done, the issue does not happen anymore.

Another way to "fix" the issue to work with vim-tmux-focus-events is by leaving let &term = &term and just having something like this (2 lines below added, they replicate what vim-tmux-focus-events does):

let &term = &term
exec "set <F24>=\<Esc>[O"
exec "set <F25>=\<Esc>[I"

@jamessan
Copy link
Owner

@bruno- Or for vim-tmux-focus-events to set any of their term-related settings when the TermChanged autocmd triggers, as I suggested in #38 (comment).

@bruno-
Copy link

bruno- commented Sep 29, 2015

Thank you very much sir, that's the right way to handle this!
It's now fixed tmux-plugins/vim-tmux-focus-events@bb36f0c, case closed.

@jamessan
Copy link
Owner

Thanks! Now I just need to find time to try and fix the vim + gnupg interaction that required this workaround. :)

@jamessan jamessan closed this as completed Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants