Start the agent with
- $ GPG_TTY=$(tty)
- $ gpg-agent --daemon --write-env-file "${HOME}/.gnupg/agent-info"
- $ echo "GPG_TTY='${GPG_TTY}'; export GPG_TTY" >> "${HOME}/.gnupg/agent-info"
+ $ gpg-agent --daemon --display "${DISPLAY}" --ttyname $(TTY) --keep-tty --keep-display --write-env-file "${HOME}/.gnupg/agent-info"
$ source "${HOME}/.gnupg/agent-info"
-The `GPG_TTY` bit will spawn the `pinentry` call in the designated
+The `ttyname` bit will spawn the `pinentry` call in the designated
TTY. This avoids troublesome issues like pinentry clobbering [[Mutt]]
if they are both using ncurses.
$ killall gpg-agent
$ rm -f "${HOME}/.gnupg/agent-info"
+Since these commands are tedious to remember and type, I've wrapped
+them in little scripts: [[gpg-agent-spawn.sh]] and
+[[gpg-agent-kill.sh]].
+
[gpg-agent]: http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html
[[!tag tags/linux]]