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

:Gpush freezes when used with neovim #722

Closed
lzh9102 opened this issue Nov 24, 2015 · 18 comments
Closed

:Gpush freezes when used with neovim #722

lzh9102 opened this issue Nov 24, 2015 · 18 comments

Comments

@lzh9102
Copy link

lzh9102 commented Nov 24, 2015

Hello,

When running Fugitive with Neovim, the :Gpush command freezes if a password prompt is shown.

gpush

This is because neovim doesn't redirect keyboard input to the stdin of the subprocess. The only way to quit is to kill the neovim process.

The :Git command already makes use of the neovim terminal emulator so that functions like s:StagePatch() don't freeze on the password prompt. Could you also make s:Dispatch() use :terminal in neovim (something like lzh9102@dc4f285) so that :Gpush and :Gfetch don't freeze? Thank you!

@tpope
Copy link
Owner

tpope commented Nov 24, 2015

It will probably require something a bit more involved, as we are using :make to capture output.

@lewicki-pk
Copy link

I have the same problem.
@tpope Do you even consider support for neovim or are we on our own with this editor?

@tpope
Copy link
Owner

tpope commented Apr 12, 2016

Fugitive supports it but this is out of my element.

@prdx
Copy link

prdx commented Jun 18, 2016

Hi there!

I have this problem as well. However, my current workaround is to add ssh-key to your github account and use ssh instead of https.

@davidCarlos
Copy link

+1

@gbrlsnchs
Copy link

This issue still exists when credentials are requested...

@shym
Copy link

shym commented Jun 10, 2017

Would it help to use a poor workaround like setting GIT_ASKPASS='true' (when it is not set to something else) so that git gets the empty password instead of hanging everything?

@tpope
Copy link
Owner

tpope commented Jun 10, 2017

That's a good idea, though we should check that we're not overriding core.askPass. Or perhaps just set SSH_ASKPASS because it has the lowest precedence.

On that note, we could use git-gui--askpass or even ssh-askpass if available and we're running under a GUI. But I'm not sure what a good check for running under a GUI would be.

@sfzylad
Copy link

sfzylad commented Jul 7, 2017

Not sure if it's the same problem I'm encountering, but :Glog freezes for me almost every other time I run it.

@shym
Copy link

shym commented Jul 22, 2017

@sfzylad, to make sure what you mean by freeze: Glog is not run asynchronously, it waits for git log to finish (which might take a little time). Is that what you mean?
If not, can you elaborate? But I hardly see how this could be really related, since git log does not require a password.

@sitilge
Copy link

sitilge commented Aug 14, 2017

Ping, same here, running nvim v0.2.0.

@irishmac473
Copy link

Same here, running nvim v0.2.1.

@paolousero
Copy link

paolousero commented Jan 12, 2018

Encountering this same problem in nvim v0.2.2.

@sitilge
Copy link

sitilge commented Jan 12, 2018 via email

@tpope
Copy link
Owner

tpope commented Jan 25, 2018

Here's an overly elaborate vimrc snippet to use git-gui--askpass or ssh-askpass which y'all can test as a potential workaround:

if (len($SECURITYSESSIONID) || len($DISPLAY)) && empty($SSH_ASKPASS)
  let s:gui_askpass = system("git --exec-path")[0:-2] . "/git-gui--askpass"
  if executable(s:gui_askpass)
    let $SSH_ASKPASS = s:gui_askpass
  elseif executable("ssh-askpass")
    let $SSH_ASKPASS = "ssh-askpass"
  endif
endif

You'll need at least one of those two tools installed, obviously.

@ssiccha
Copy link

ssiccha commented Feb 1, 2018

@tpope This works for me. I'm using NVIM v0.2.1-255-g9cc185d without a GUI and have ssh-askpass installed.

ssiccha added a commit to ssiccha/.vim that referenced this issue Feb 6, 2018
@tpope tpope closed this as completed in adba9c6 Jul 18, 2019
@doronbehar
Copy link

Hey @tpope, thanks for caring and pushing these changes. I've checked out the latest version today (80996c2) and it seems :term isn't being used at all in s:Displatch right? From my initial testings of :Gpush, in an X session I got the Graphical x11-ssh-askpass working which is fine. But, I got this error when $DISPLAY was unset:

|| git@github.com: Permission denied (publickey).
|| fatal: Could not read from remote repository.
|| 
|| Please make sure you have the correct access rights
|| and the repository exists.

It's as if no askpass was found in that setup and therefor the git push command failed..

Besides this issue which might interest you, I will confirm though, in relation to your comment in #1052 (comment), that having both https://github.com/tpope/vim-dispatch and https://github.com/radenling/vim-dispatch-neovim installed, gives a UX I'm satisfied with, as a Neovim user - :terminal is always used for :Gpush.

If anyone has come to depend on my fork of fugitive, I'm archiving it.

@tpope
Copy link
Owner

tpope commented Jul 26, 2019

Correct, no :terminal, just :Make if dispatch.vim is installed and :make if not.

I am not particularly satisfied with this solution, but as someone who doesn't enter their password on every single fetch, that's the priority. Side note, I recommend everyone use ssh keys or credential caching or anything other than typing in your password like an animal each time, you deserve it.

brendeschuijmert pushed a commit to brendeschuijmert/vim-fugitive that referenced this issue Aug 6, 2019
brendeschuijmert added a commit to brendeschuijmert/vim-fugitive that referenced this issue Apr 13, 2020
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