From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Fix needed for communication with gpg-agent Date: Sun, 18 Feb 2007 12:42:26 -0500 Message-ID: <87irdzs6pp.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171820577 19719 80.91.229.12 (18 Feb 2007 17:42:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Feb 2007 17:42:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 18 18:42:50 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HIq3l-0007N3-Aw for ged-emacs-devel@m.gmane.org; Sun, 18 Feb 2007 18:42:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIq3k-00044Q-Pb for ged-emacs-devel@m.gmane.org; Sun, 18 Feb 2007 12:42:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HIq3Z-00044B-LG for emacs-devel@gnu.org; Sun, 18 Feb 2007 12:42:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIq3Y-000442-Cl for emacs-devel@gnu.org; Sun, 18 Feb 2007 12:42:36 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HIq3X-0002Sg-T1; Sun, 18 Feb 2007 12:42:36 -0500 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l1IHgYR2025482; Sun, 18 Feb 2007 12:42:34 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id l1IHgRfk015252; Sun, 18 Feb 2007 12:42:27 -0500 (EST) Original-Received: from localhost (SYDNEYPACIFIC-SIX-TWENTY-SEVEN.MIT.EDU [18.95.7.116]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l1IHgQpP008810; Sun, 18 Feb 2007 12:42:27 -0500 (EST) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HIq3O-0002iL-00; Sun, 18 Feb 2007 12:42:26 -0500 In-Reply-To: (Richard Stallman's message of "Sat\, 17 Feb 2007 15\:57\:37 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: 0 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66505 Archived-At: Richard Stallman writes: > Would someone please implement this code, needed for correct > redisplay after running pinentry? Then please ack. > > ... > > Without X, Pinentry falls back to a curses implementation (there is > also a curses only version of Pinentry). This works pretty reliable > but poses one problem: The screen needs a redraw as there is no > portable way to save and restore the old screen content. What can be > done is to redraw the screen every time after calling a crypto > operation which uses gpg or gpgsm. This is of course not optimal as > in most cases the passphrase has been cached and an expensive redraw > is not required. I don't see any reasonable way to do this. Roughly speaking, when Emacs is run in a console (i.e. as a curses program), it monopolizes terminal input and output. I don't know of any way to call the curses version of pinentry, have it temporarily "take over" the terminal, and return control to Emacs once it's done. I suggest filing this in TODO or PROBLEMS. There is a kind of workaround: if you first use gpg-agent outside of Emacs to cache your passphrase, subsequent use of gpg-agent from in Emacs will work since gpg-agent no longer needs to prompt for your passphrase.