Closed zamlz closed 6 months ago
in my case, this bug only appear if I have
# ~/.config/lazygit/config.yml
git:
overrideGpg: true
when I checked the code, it will trigger this runAndStream
function and probably the issue is coming from there?
https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/controllers/helpers/gpg_helper.go#L40
if I disable that config, it works just fine, but I still need overrideGpg
so I can reword commit or patch it later
hope this information helps, thanks!
Okay so wait? setting it to false
lets me use pinentry-curses when I create commits! Unfortunately, it does work when pushing to the repo. Probably because it's technically coming through ssh? Any recommendations for dealing with SSH
@stefanhaller thank you for your work on this! I can't wait to try it! Do you have an eta on when will the next release be available? No worries, if that is not known yet. I'm just excited to try it because it's the only thing preventing me from using this app.
Cheers!
RIP me doing all the work 😆
jk-ing, glad it helped other people 🥳
@eldios I'm sorry, I saw the the line directly above,
stefanhaller added a commit that referenced this issue Apr 9, 2024
and I had assumed!
If I looked carefully, I would have known! Thank you for you work on this! I can't wait to try it!
For some reason I still get this issue although it is considered fixed in a mentioned commit. My context is tmux + neovim + lazygit in WSL2 in the native windows terminal:
$ env | grep TERM
TERM_PROGRAM_VERSION=3.2a
TERM=xterm-256color
TERM_PROGRAM=tmux
I tried a bunch of settings and playing with both gpg and lazygit configs but in the end I've identified two workarounds:
a) use pinentry-gtk-2
(or another graphical pinentry) which just holds lazygit waiting until the pinentry is done. you should get a X window to enter your passphrase. on return, lazygit looks fine, no scrambles.
b) follow the guide here: https://sbulav.github.io/vim/neovim-signing-git-commits/#configure-gpg-to-work-with-neovim to setup loopback mode for pinentry which I did not have. In loopback mode you don't get the ncurses look.
Essentially you will need to add or edit your ~/.gnupg/gpg.conf
:
use-agent
pinentry-mode loopback
and then edit your ~/.gnupg/gpg-agent.conf
to allow loopback:
pinentry-program "/usr/bin/pinentry"
allow-loopback-pinentry
I'm getting now a blank Enter passphrase:
prompt which works reliably and is good enough for me for a pure CLI experience. the GTK option is not that lightweight or an option at all in SSH contexts where the server should not have X packages installed.
@amne Thanks a lot. I was having the same issue but using WezTerm on MacOS
@amne I tried this and it outputs the following error:
fatal: Failed to decrypt file '/home/smc242/.password-store/git/https/azdev.companyname.com/smc242.gpg' with gpg. exit=2, out=, err=gpg: Sorry, we are in batchmode - can't get input
Any ideas? I'm using Alacritty and Git Credential Manager
Describe the bug The issue is that
lazygit
starts behaving weird when it tries to use a pinentry program that is terminal based. It ends up breaking the program completely.To Reproduce Steps to reproduce the behavior:
pinentry-curses
orpinentry-tty
.Expected behavior The pinentry program should take focus of the program
Screenshots
Version info:
commit=, build date=, build source=nix, version=0.40.2, os=linux, arch=amd64, git version=2.43.0
git version 2.43.0