pinetry and emacs

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

pinetry and emacs

Phillip Susi-3
I have installed the pinetry module and run M-x pinentry-start, as well
as added allow-emacs-pinentry to ~/.gnupg/gpg-agent.conf, yet whenever I
try signing an email in mu4e, pinentry gets into a fight with emacs over
the tty and everything goes all fscked up.  Why is this?  Why does
pinentry still try to take over the terminal instead of contacting
emacs?  For that matter, why can both programs fight over it?  I thoguht
only one process group was the foreground group, and only that process
group could read input from the tty.  Instead it seems like both
programs are reading some of the input and so I can't get emacs to
switch buffers, nor pinentry to enter the correct password, nor cancel.

I'm on Ubuntu 20.04 with pinentry 1.1.0 and emacs 26.3.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

GnuPG - User mailing list
Have you tried checking with update-alternatives which pinentry is default selected?
I remember having to switch mine from pinentry-gnome to pinentry-tty on my machine (I don't use emacs though).

On Tue, Feb 9, 2021 at 9:22 PM Phillip Susi <[hidden email]> wrote:
I have installed the pinetry module and run M-x pinentry-start, as well
as added allow-emacs-pinentry to ~/.gnupg/gpg-agent.conf, yet whenever I
try signing an email in mu4e, pinentry gets into a fight with emacs over
the tty and everything goes all fscked up.  Why is this?  Why does
pinentry still try to take over the terminal instead of contacting
emacs?  For that matter, why can both programs fight over it?  I thoguht
only one process group was the foreground group, and only that process
group could read input from the tty.  Instead it seems like both
programs are reading some of the input and so I can't get emacs to
switch buffers, nor pinentry to enter the correct password, nor cancel.

I'm on Ubuntu 20.04 with pinentry 1.1.0 and emacs 26.3.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users


--
Med vennlig hilsen/Kind regards,
Christian Chavez
Phone/Tlf: +47 922 22 603

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

Phillip Susi-3

Christian Chavez writes:

> Have you tried checking with update-alternatives which pinentry is default
> selected?
> I remember having to switch mine from pinentry-gnome to pinentry-tty on my
> machine (I don't use emacs though).

It was pinentry-curses.  I tried switching to pinentry-tty and it rapes
the tty even worse than the curses one.  At least some keystrokes
occasionally had some effect with the curses one.  With This one nothing
I hit would do anything.  Couldn't get it to eventually think I entered
a wrong password and give up, couldn't C-c, C-g, or C-z; I just had to
use ~. to force ssh to hang up.  Why and how is this program so abusive
of the terminal?

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

Phillip Susi-3

Phillip Susi writes:

> It was pinentry-curses.  I tried switching to pinentry-tty and it rapes
> the tty even worse than the curses one.  At least some keystrokes
> occasionally had some effect with the curses one.  With This one nothing
> I hit would do anything.  Couldn't get it to eventually think I entered
> a wrong password and give up, couldn't C-c, C-g, or C-z; I just had to
> use ~. to force ssh to hang up.  Why and how is this program so abusive
> of the terminal?

Weird... I ran strace on the program from another terminal and could see
that it was reading each keystroke, but continued to read after seeing
the \r.  I hit C-j ( \n ) and it finally recognized the end of input.
I'm thinking that it requires that tty mode that appends a \n to a \r to
be enabled, but it doesn't bother enabling it when it takes over the
tty.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

Pankaj Jangid
Phillip Susi <[hidden email]> writes:

>> It was pinentry-curses.  I tried switching to pinentry-tty and it rapes
>> the tty even worse than the curses one.  At least some keystrokes
>> occasionally had some effect with the curses one.  With This one nothing
>> I hit would do anything.  Couldn't get it to eventually think I entered
>> a wrong password and give up, couldn't C-c, C-g, or C-z; I just had to
>> use ~. to force ssh to hang up.  Why and how is this program so abusive
>> of the terminal?
>
> Weird... I ran strace on the program from another terminal and could see
> that it was reading each keystroke, but continued to read after seeing
> the \r.  I hit C-j ( \n ) and it finally recognized the end of input.
> I'm thinking that it requires that tty mode that appends a \n to a \r to
> be enabled, but it doesn't bother enabling it when it takes over the
> tty.

I faced the same issue when I started Emacs from virtual terminal
window. But I do not get the issue when launching from directly GUI. I
am on MacOS.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

Phillip Susi-3

Pankaj Jangid writes:

> I faced the same issue when I started Emacs from virtual terminal
> window. But I do not get the issue when launching from directly GUI. I
> am on MacOS.

Even if you run emacs from a terminal emulator, as long as you are in a
GUI environment, then the gui pinentry should be used afaik.  I'm using
a remote server via ssh so I'm restricted to the terminal.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Reply | Threaded
Open this post in threaded view
|

Re: pinetry and emacs

Pankaj Jangid
Phillip Susi <[hidden email]> writes:

> Even if you run emacs from a terminal emulator, as long as you are in a
> GUI environment, then the gui pinentry should be used afaik.

I also think so. But I could not manage to configure it even after few
attempts.

I use Homebrew packages on this mac. On one older macbook I have
recently installed packages using Ports system. And after installing
GnuPG on that, I have noticed a GUI app pinentry-mac. Probably that will
pop-up some kind of GUI for asking passphrase. I’ll update in this
thread after trying that out.

_______________________________________________
Gnupg-users mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-users