Hello, I'm now trying to improve interactions between Emacs and gpg-agent, on text-only consoles. See the following post for detail. From: Richard Stallman Subject: Fix needed for communication with gpg-agent Date: Sat, 17 Feb 2007 15:57:37 -0500 Message-ID: http://article.gmane.org/gmane.emacs.devel/66490 The idea is simple: allow a child process (gpg-agent) to temporarily access the controlling terminal of Emacs. It can be done by passing the actual device name (something like "/dev/pts/XX") to the child process. However, I couldn't find any portable way to do this in Lisp level. The function terminal-name always returns "/dev/tty" on GNU/Linux. So I'd like to propose a change of terminal-name to return the actual device file name. I'll attach a couple of files in this mail. One is the patch, and another is a test-case which directly interacts with pinentry-curses (which is a subprogram used by gpg-agent), within Emacs. In this patch, I assumed that terminal->name (in C) is only used for informational purposes. Please correct me if I am wrong.