1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-10 20:31:13 +00:00

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.
This commit is contained in:
romkatv 2020-03-02 09:27:40 +01:00 committed by Jeff Widman
parent 92e6b37f73
commit 94f9e44f3f

View File

@ -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