Terminal pinentry in termux

classic Classic list List threaded Threaded
3 messages Options
CB
Reply | Threaded
Open this post in threaded view
|

Terminal pinentry in termux

CB
Hello,

I'd like to ask how to configure terminal minibuffer pinentry in emacs?
On my laptop, where I run GUI Emacs it works perfectly. But on my
tablet, where I have it run in termux it tries to use the gnupg (curses
I guess) pinentry instead of the minibuffer. How could I copy the GUI
behavior on termux?

Thank you and kind regards,

CB

Reply | Threaded
Open this post in threaded view
|

Re: Terminal pinentry in termux

Kridsada Thanabulpong-2
Hi,

AFAIK, gpg-agent will use the INSIDE_EMACS environment variable to detect
whether GnuPG is being called inside Emacs then forward pinentry to the
Emacs pinentry socket (usually /tmp/emacs<uid>/pinentry) if exists.

My first guess would be something is causing $INSIDE_EMACS to not being
set properly under Termux. You could try to run, inside scratch buffer:

    (getenv "INSIDE_EMACS")

...to see if it was set. If it wasn't, I'm not sure how the variable
was set normally, but in my .emacs I have this line:

    (setenv "INSIDE_EMACS" emacs-version)

To ensure it's present no matter how I run Emacs. If it was already set
then maybe try to inspect if pinentry socket exists at
/tmp/emacs<uid>/pinentry.

Also, if you happen to run gpg-agent as ssh-agent, you'd need to have:

    (shell-command "gpg-connect-agent updatestartuptty /bye" "*gpg-update-tty*")

Line somewhere in your .emacs (but INSIDE_EMACS must also already be set).
There's no way for gpg-agent to know which tty to use via the ssh-agent
protocol, but the command also happens to call the function that updates
agent to forward pinentry to Emacs.

Regards,
Kridsada

CB <[hidden email]> writes:

> Hello,
>
> I'd like to ask how to configure terminal minibuffer pinentry in emacs?
> On my laptop, where I run GUI Emacs it works perfectly. But on my
> tablet, where I have it run in termux it tries to use the gnupg (curses
> I guess) pinentry instead of the minibuffer. How could I copy the GUI
> behavior on termux?
>
> Thank you and kind regards,
>
> CB

Reply | Threaded
Open this post in threaded view
|

Re: Terminal pinentry in termux

Eli Zaretskii
In reply to this post by CB
> From: CB <[hidden email]>
> Date: Thu, 31 Jan 2019 19:20:35 +0800
>
> I'd like to ask how to configure terminal minibuffer pinentry in emacs?
> On my laptop, where I run GUI Emacs it works perfectly. But on my
> tablet, where I have it run in termux it tries to use the gnupg (curses
> I guess) pinentry instead of the minibuffer. How could I copy the GUI
> behavior on termux?

Try looking in NEWS, the answer should be there, I think.