Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119356 - pinentry messes up mutt and vim input and display.
Summary: pinentry messes up mutt and vim input and display.
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-17 17:07 UTC by Abraham Smith
Modified: 2013-01-12 18:25 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abraham Smith 2006-01-17 17:07:12 UTC
I apologize in advance that this bug report is so scatter-brained.  Googling has shown that not many people have complained about this issue, but that it has gone on in various forms for about two years. It requires a fairly complicated set of conditions, but for those (few) of us who want to manage encryption with gpg-agent and love mutt, it seems killer.

Since the gentoo community encourages the use of keychain and mutt, I thought I'd ask for help here before moving upstream.

PROBLEM:

After using pinentry-curses to enter gpg-agent passphrase in mutt, the interface to mutt get's hosed.  For instance, after pineentry-curses successfully runs, mutt doesn't know what the UP and DOWN keys do; it returns only "Key is not bound. Press '?' for help."

REPRODUCE:  
1) emerge mutt with gpgme support, and emerge latest versions of gpgme, gpg-agent, and pinetry.

2) put "pinentry /usr/bin/pinentry-curses" in ~/.gnupg/gpg-agent.conf so that the X passphrase interface is not used.

3) start a gpg-agent --daemon.

4) make sure the GPG_TTY variable is set to $(tty), and run mutt.  Try to open an encrypted mail or sign a mail.  pinentry-curses comes up, the passphrase is requested, then mutt returns

RESULT:
There may or may not be curses screen artifacts, and UP/DOWN keys fail to work in mutt.

COMMENTS:
This year-old thread claims it's fixed, but things have changed since then with gpgme:
 http://www.intevation.de/roundup/aegypten/issue277

I tried to apply the same idea by adding
  keypad (stdscr, TRUE);
  clearok (stdscr, TRUE);
to lines 3695-6 of crypt-gpgme.c, but it didn't work.




Another note:  If this mutt is in the same screen session as a vim, the vim appears to get hosed in the same way (arrow keys die), but running pinsentry-curses directly from gpg (NOT from within mutt) along side a vim in screen, vim is not hosed.
Comment 1 Sven Wegener gentoo-dev 2006-02-23 13:39:04 UTC
The patch mentioned in the thread has never been integrated by upstream into mutt. 
Comment 2 Abraham Smith 2006-02-23 14:31:24 UTC
Okay, I just tried their patch by hand in mutt-1.5.11, by just commenting out the "if" and the brackets.  It appears to work for mutt on its own:

Line 71 of curs_lib.c
//  if (!getenv ("DISPLAY"))
//  {
    keypad (stdscr, TRUE);
    clearok (stdscr, TRUE);
    set_option (OPTNEEDREDRAW);
//  }


However, this problem still occurs within GNU/screen.  Any thoughts on how to patch it there?


I guess the best solution is to track down the problem in pinentry itself instead of every program it shares a terminal with...
Comment 3 Mike Kelly (RETIRED) gentoo-dev 2007-01-11 05:25:56 UTC
Not really sure this is a vim-specific problem. Feel free to re-add us to the CC if it ends up seeming that way.
Comment 4 Nick White 2009-08-24 12:46:33 UTC
I don't have time to look into this at present, but an ugly workaround when in GNU screen is to just pretend you're not.

e.g. in my .bashrc I have the following line:

alias mutt="TERM=rxvt-unicode; mutt"
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2013-01-12 18:25:18 UTC
Hi,
Please take this to upstream.
It is not Gentoo specific issue.
Thanks.