This is the content of my .gnupg/gpg-agent.conf:

pinentry-program /usr/bin/pinentry-curses

When I try to retrieve a password from pass' store, e.g. via pass -c path/to/password in a very small-sized terminal window, the command errors like this:

gpg: decryption failed: No secret key

So it's an error from GnuPG, caused, I believe, by not enough space for ncurses to draw the pinentry dialog.

Can anybody reproduce this? If so, where can I report this bug?

enter image description here

  • 1
    You can get information about packages from your package manager. Eg if you're in a debianlike distro such as ubuntu you could apt-cache show gnupg. It gives both the package homepage and a link for filing bug reports. Btw your question isn't really about gnupg, it is about "How to find where to file bug reports?"
    – cryptarch
    Feb 23, 2021 at 0:46

1 Answer 1


Whenever you report a (suspected) bug, you should state the behavior you observe and what you expected instead. So in this case, and as you opened a bug report with GnuPG, you should state what you think should happen. If you add it here, you should edit the question, not add it only in a comment. See also the suggestions at the bottom.

Yes, this happens because the window is too small. It also doesn't originate from GnuPG: GnuPG just calls the pinentry-program you specified in the configuration.

For details about what happens, we can try to call it manually.

$ stty cols 20 rows 10
$ pinentry-curses 
OK Pleased to meet you
S ERROR curses.dialog_create 83886381 
ERR 83886381 Screen or window too small <Pinentry>

Here I first made the tty size small and then called pinentry-curses. It waits for a command, I typed GETPIN, the command to acquire the PIN. It complains that the screen is too small to display the dialog. GnuPG just reports that it can't get the PIN.

I saw what you wrote it the ticket, but what you propose is between difficult and impossibly, because gpg should not care about terminal size, and therefor should not claim that the terminal is too small.

Instead I would suggest the following text (I don't want to create an account there):

gpg calls the pinentry-program if it needs to decrypt a key. It would be better for the user if pgp wouldn't display the generic message
decryption failed: No secret key
and instead forwarded the message from the pinentry-program, something like:
Can't decrypt key, pinentry-program failed with (text from ERR response).

Additionally, if pinentry-curses is maintained by the gpg team, it could detect a small windows and behave the same as when $TERM is unset, avoiding this error.

  • Ok, but the error I get is gpg: ..., so at least gpg is catching the exception (?) bubbling up from pinentry and it's forwarding it to the terminal with an unrelated error message. I've opened the bug report T5322.
    – Enlico
    Feb 24, 2021 at 10:15
  • 1
    @Enlico pgp is just reporting the error. Exception is not the correct term here. As you have opened a bug, please also include an expected behavior (in the bug, not here). My suggestion would be that pgp should print the message received by the pinentry program, such as Operation cancelled (the message when user selects cancel) or Screen or window too small. Also, pinentry-curses with a small window could behave as with unset $TERM.
    – RalfFriedl
    Feb 24, 2021 at 12:29
  • @RalfFriedl, I've commented in the bug report, as you suggested.
    – Enlico
    Feb 24, 2021 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.