use $TTY instead of $(tty); it's faster and more reliable

`tty` command infers the current TTY from file descriptor 0.
`$TTY` gives current TTY directly. The latter works even when
file descriptor 0 is redirected. It's also over 1000 times faster.
main
romkatv 5 years ago committed by Jeff Widman
parent 92e6b37f73
commit 94f9e44f3f

@ -26,7 +26,7 @@ if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]];
fi fi
# Inform gpg-agent of the current TTY for user prompts. # Inform gpg-agent of the current TTY for user prompts.
export GPG_TTY="$(tty)" export GPG_TTY=$TTY
# Integrate with the SSH module. # Integrate with the SSH module.
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then

Loading…
Cancel
Save