Skip to content

Commit a2a03a8

Browse files
authored
Set an empty GPG_TTY for git fetch with gpg-agent (#647)
1 parent e1ae401 commit a2a03a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pure.zsh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,10 @@ prompt_pure_async_git_fetch() {
325325
export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-"ssh"} -o BatchMode=yes"
326326

327327
# If gpg-agent is set to handle SSH keys for `git fetch`, make
328-
# sure it uses this zpty instead of corrupting the parent TTY.
329-
export GPG_TTY=$TTY
328+
# sure it doesn't corrupt the parent TTY.
329+
# Setting an empty GPG_TTY forces pinentry-curses to close immediately rather
330+
# than stall indefinitely waiting for user input.
331+
export GPG_TTY=
330332

331333
local -a remote
332334
if ((only_upstream)); then

0 commit comments

Comments
 (0)