emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix needed for communication with gpg-agent


From: Kim F. Storm
Subject: Re: Fix needed for communication with gpg-agent
Date: Tue, 20 Feb 2007 16:11:40 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Chong Yidong <address@hidden> writes:

> Richard Stallman <address@hidden> 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.

So why does Werner say that "this works pretty reliable" ...?

>
> 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.

Well, if Emacs just "sleeps" while it waits for gpg to finish, then we
can assume that pinentry has finished using the screen as well.

accept-process-output has a just-this-one argument which causes emacs
to wait without reading the keyboard (it will still run timers though).

Maybe we use that to wait for gpg + pinentry already?  I guess Emacs
cannot really continue without getting the result from gpg.

.. and if we waited for more than a few seconds for gpg to complete,
we can (safely) assume that the user was involved, and redraw the
screen.  (so no need to implement the "protocol".)

Of course, we only need to do any of this if "no X".

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]