aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home
diff options
context:
space:
mode:
authorLibravatar sommerfeld <[email protected]>2026-04-17 14:47:34 +0100
committerLibravatar sommerfeld <[email protected]>2026-04-17 14:47:34 +0100
commitc6eb8e5092b22e4bb611deb5a11273547f8b1f1e (patch)
tree30373b2ac0f40bc79b2e6aa74a6972706784dc7b /home
parente2da9bd7318c3811b344c756358104fd8c7e4994 (diff)
downloaddotfiles-c6eb8e5092b22e4bb611deb5a11273547f8b1f1e.tar.gz
dotfiles-c6eb8e5092b22e4bb611deb5a11273547f8b1f1e.tar.bz2
dotfiles-c6eb8e5092b22e4bb611deb5a11273547f8b1f1e.zip
fix: set GPG_TTY per interactive shell, not just at login
GPG_TTY was set in .zprofile (login shell) to /dev/tty1, but terminal emulator shells get /dev/pts/N. Move the export to .zshrc so each interactive shell sets the correct TTY before telling the agent.
Diffstat (limited to 'home')
-rw-r--r--home/.config/zsh/.zprofile1
-rw-r--r--home/.config/zsh/.zshrc4
2 files changed, 3 insertions, 2 deletions
diff --git a/home/.config/zsh/.zprofile b/home/.config/zsh/.zprofile
index c1af85d..30b5b21 100644
--- a/home/.config/zsh/.zprofile
+++ b/home/.config/zsh/.zprofile
@@ -39,7 +39,6 @@ export LESS="-F --RAW-CONTROL-CHARS"
[[ -r /usr/bin/source-highlight-esc.sh ]] && export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"
# ── GPG / SSH ─────────────────────────────────────────────────────────────────
-export GPG_TTY=$TTY
unset SSH_AGENT_PID
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc
index bd03e8b..fad4bca 100644
--- a/home/.config/zsh/.zshrc
+++ b/home/.config/zsh/.zshrc
@@ -283,7 +283,9 @@ compdef sys=systemctl ssys=systemctl sysu=systemctl
compdef l=lsd la=lsd lt=lsd
# ── GPG agent ─────────────────────────────────────────────────────────────────
-# Refresh gpg-agent's TTY so pinentry prompts appear in the right terminal
+# Set GPG_TTY to this shell's actual TTY (not the login console) and tell
+# the agent so pinentry prompts appear in the right terminal
+export GPG_TTY=$TTY
gpg-connect-agent updatestartuptty /bye &>/dev/null
# ── Zoxide (smart directory jumping) ──────────────────────────────────────────