Closed Strongleong closed 3 months ago
Thanks - managed to reproduce this.
Am I correct that you have GPG_TTY
set in your shell?
Ok, spent the last hour doing some reading: Using the pinentry-curses
program will not work with neovim. https://github.com/tpope/vim-fugitive/issues/1836#issuecomment-918677504 Fugative has the exact same issue - it's not something I can do anything about.
However, there is a way to set up gpg to work with neovim/neogit. Make sure these conf files contain these lines:
# ~/.gnupg/gpg-agent.conf
pinentry-program /opt/homebrew/bin/pinentry-tty
allow-loopback-pinentry
# ~/.gnupg/gpg.conf
pinentry-mode loopback
With that set up, neogit will catch when you are prompted for a password, and you will be able to input it.
Thank you very much! Your solution did work really nice!
I think this should be documented somewhere
And yes, I do in fact have $GPG_TTY set
Yeah, I'll add documentation, good call :)
I'm having this issue on Debian however I've tried using the solution above and it hasn't worked. I'm still getting the gpg password entry that's drawing over Neovim causing issues and the commit to fail
Maybe on debian older version of gpg that searching different folders/files for configs?
It does actually change the password prompt on the terminal to a cli based one instead of the ncurses one however when I try use it with neogit I get the same problem where I can't enter my password
That blue block of text is being drawn over neovim which is preventing me from entering my password to it. Without me interacting with it, it then changes to the following:
At this point neovim is entirely frozen and no matter what keybinds I use, including
seems like either an ENV related thing, or a git config issue. Neogit is spawning a sub-process PTY to do the commit - it looks like the ncurses UI is still in effect there.
Ah so do you think that it could be because I have git set to sign every commit in my git config?
In my terminal this is what I see when doing a git commit
Not exactly - It shouldn't really matter how frequently it asks. Though... the screenshot you posted is using OpenPGP, which I haven't tried. I'm using gnupg. That might be the issue, maybe. Perhaps you could try this branch and see if it resolves anything: https://github.com/NeogitOrg/neogit/pull/1374
However, I suspect that however you're telling OpenPGP to not use ncurses isn't being read or exported properly. But lets see.
Unfortunately that's still not working. Still seeing neovim freezing and the ncurses thing drawing over. I'll see if there's a way to tell OpenPGP not to do that.
Also thank you very much for your replies and help with this!
Just checked and it seems I only have gpg installed. It must only be saying openPGP in that prompt because it is an implementation of openPGP
I've worked it out. My gpg config files were in the wrong place. GPG was expecting them to be in $XDG_DATA_HOME/gnupg rather than ~/.gnupg. Thanks for your help!
Great :) Seemed like that was the issue.
Description
When I have enabled GPG signing and I try to commit this happens: https://github.com/NeogitOrg/neogit/assets/17177071/6a8bbd8b-b9a7-446e-9a67-e4d9cef47b7b
No matter what I type, GPG rejects it, neovim behaves unpredictable and only <Ctrl+c> helps. But console now in broken state (typing
reset
helps)Neovim version
NVIM v0.9.5 Build type: Release LuaJIT 2.1.0-beta3 Compilation: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/include -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/cmake.config -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include
system vimrc file: "/etc/vim/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
Operating system and version
Gentoo (kernel version 6.1.69)
Steps to reproduce
nvim -nu minima.lua
:Neogit
Expected behavior
Neogit prompts for GPG password and creates signed commit. Nothing is broken
Actual behavior
GPG password prompt pops up, Neogit tries to "fight" it. Broken console. Commit is not created
Minimal config