Created attachment 4335 patch Xfce runs gpg-agent (when available) from an xinitrc script. The commands gpg-agent returns depend on the user's shell. When you run gpg-agent from an sh script you must pass the --sh flag to make sure it returns sh commands. There are similar flags for ssh-agent and dbus-launch which the xinitrc script already uses. I've attached a patch that fixes this. The patch also improves the kill command for gpg-agent by extracting the pid from the GPG_AGENT_INFO environment variable. The variable has 3 colon-separated fields. The second is the pid.
Not an issues anymore in 4.10 since the shell is not used anymore.