local/bin/homeinit: Add compatibility for non-Emacs terminals.
parent
83b71b2034
commit
28c2c5b07d
|
@ -146,9 +146,10 @@ if has_gpg_keys; then
|
||||||
## Set up gpg-agent to authenticate to SSH_ROOT.
|
## Set up gpg-agent to authenticate to SSH_ROOT.
|
||||||
chmod -R go-rwx ~/.gnupg
|
chmod -R go-rwx ~/.gnupg
|
||||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||||
if [ "$GPG_TTY" != "not a tty" ]; then
|
if [ "$GPG_TTY" != "not a tty" ] || [ -z "$INSIDE_EMACS" ]; then
|
||||||
## If a TTY, since our ~/.gnupg/gpg-agent.conf exists and specifies a
|
## If a TTY, since our ~/.gnupg/gpg-agent.conf exists and specifies the Emacs
|
||||||
## pinentry, we must force the TTY version or else it won't work from a TTY.
|
## pinentry, we must force the TTY version or else it won't work from a TTY.
|
||||||
|
## Same if not in Emacs (e.g. Xterm).
|
||||||
gpgconf --kill gpg-agent
|
gpgconf --kill gpg-agent
|
||||||
cat<<EOF>"$(dirname "$PROFILE")/gpg-agent.conf"
|
cat<<EOF>"$(dirname "$PROFILE")/gpg-agent.conf"
|
||||||
## 1-day timeout
|
## 1-day timeout
|
||||||
|
|
Loading…
Reference in New Issue