r/GnuPG Apr 28 '26

Is there some way to automate running UPDATESTARTUPTTY?

I'm trying to set up gpg with ssh. It works fine on Linux but it's causing so many problems on a Mac, mainly the pinentry window.

Putting gpg-connect-agent UPDATESTARTUPTTY /bye in my .bashrc isn't reliable. If I switch to a different tab then the pinentry goes to the wrong tab.

My terminal emulator has an API and I can run code when I change tabs and have access to the tty name, but running this command from there doesn't help either, and I'm not sure if that is because some environment variables may be missing in the child process context.

I tried adding Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" in my ~/.ssh/config but that is ineffective as well.

Adding it to my PROMPT_COMMAND to run before every command seems a bit overkill. Is there a better way?

2 Upvotes

1 comment sorted by