From 296bdd6fe57fa8375f173ba24b52f6f2c9ca20e5 Mon Sep 17 00:00:00 2001 From: Ben Kreeger Date: Wed, 9 Jul 2025 10:26:10 -0500 Subject: [PATCH] Fix GPG/pinentry settings for lazygit --- .gitignore | 2 ++ gnupg/gpg-agent.conf | 10 ++++------ gnupg/gpg.conf | 2 ++ lazygit/config.yml | 2 +- zsh/functions.zsh | 3 +++ zsh/zprofile | 3 +++ zsh/zshenv | 1 - 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index acee54c..d788821 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ gnupg/* !gnupg/sshcontrol zed/prompts/ + +lazygit/state.* diff --git a/gnupg/gpg-agent.conf b/gnupg/gpg-agent.conf index 1b2acad..39372fd 100644 --- a/gnupg/gpg-agent.conf +++ b/gnupg/gpg-agent.conf @@ -1,13 +1,11 @@ # https://github.com/drduh/config/blob/main/gpg-agent.conf # https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html + enable-ssh-support ttyname $GPG_TTY default-cache-ttl 60 max-cache-ttl 120 -pinentry-program /usr/bin/pinentry-curses -#pinentry-program /usr/bin/pinentry-gnome3 -#pinentry-program /usr/bin/pinentry-tty -#pinentry-program /usr/bin/pinentry-x11 -#pinentry-program /usr/local/bin/pinentry-curses -# pinent-program /usr/local/bin/pinentry-mac + +pinentry-program /usr/bin/pinentry-tty pinentry-program /opt/homebrew/bin/pinentry-mac +allow-loopback-pinentry diff --git a/gnupg/gpg.conf b/gnupg/gpg.conf index 855f420..5844cc0 100644 --- a/gnupg/gpg.conf +++ b/gnupg/gpg.conf @@ -68,3 +68,5 @@ throw-keyids #list-options show-unusable-subkeys # Verbose output #verbose +# Password entry mode +pinentry-mode loopback diff --git a/lazygit/config.yml b/lazygit/config.yml index 5a3b2ee..efb2474 100644 --- a/lazygit/config.yml +++ b/lazygit/config.yml @@ -20,5 +20,5 @@ git: args: --no-ff mainBranches: [master, main, develop] autoStageResolvedConflicts: false - overrideGpg: true + overrideGpg: false parseEmoji: true diff --git a/zsh/functions.zsh b/zsh/functions.zsh index e46fb4e..ad9a7fb 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -75,6 +75,9 @@ function update_dotfiles() { nvim --headless "+Lazy! install" +qa > /dev/null 2>&1 nvim --headless "+Lazy! clean" +qa > /dev/null 2>&1 } +function edit_dotfiles() { + nvim ~/.config/dotfiles +} # Tool functions function vide() { diff --git a/zsh/zprofile b/zsh/zprofile index 05ed58b..11f39ca 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -3,6 +3,9 @@ SCRIPTPATH=$HOME/.config/dotfiles/zsh ZSH_CACHE_DIR="$HOME/.cache/zsh" +# Let GPG know which tty we're using +export GPG_TTY="$(tty)" + # google cloud sdk if [[ -a "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc" ]]; then source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc" diff --git a/zsh/zshenv b/zsh/zshenv index 40896a5..2a04c30 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -8,7 +8,6 @@ export PATH=~/bin:$GOBIN:$PATH export XDG_CONFIG_HOME=$HOME/.config export TALOSCONFIG=$XDG_CONFIG_HOME/talos/config.yaml export GNUPGHOME=$XDG_CONFIG_HOME/gnupg -export GPG_TTY="$(tty)" export TERM=ansi kubeconfig=( $XDG_CONFIG_HOME/kube/k8s-dev.yaml