Open znz opened 7 years ago
Call gpg without emacs, lukspinentry failed.
gpg
emacs
lukspinentry
$ echo foo > foo $ LANG=C gpg -c foo gpg: problem with the agent: Invalid IPC response gpg: error creating passphrase: Operation cancelled gpg: symmetric encryption of 'foo' failed: Operation cancelled
Check with following diff, pinentry-curses called as pinentry-curses --ttyname not a tty. It seems tty via gpg-agent does not attach tty.
pinentry-curses
pinentry-curses --ttyname not a tty
tty
gpg-agent
diff --git a/lukspinentry b/lukspinentry index d6288ef..acc5635 100755 --- a/lukspinentry +++ b/lukspinentry @@ -28,9 +28,12 @@ if ( defined($DISPLAY) && !defined($SSH_TTY) ) { $pid = open2(*IN, *OUT, "pinentry-x11 -g") || die; } else { # get a tty - open F, "tty |" || die ("can't fork to tty"); + open F, "env LANG=C tty |" || die ("can't fork to tty"); my $tty = <F>; close F; +open F, "> /tmp/debug" or die "debug"; +print F "pinentry-curses --ttyname $tty"; +close F; $pid = open2(*IN, *OUT, "pinentry-curses --ttyname $tty") || die; }
You need to start emacs daemon with M-x start-server or emacs --daemon
Call
gpg
withoutemacs
,lukspinentry
failed.Check with following diff,
pinentry-curses
called aspinentry-curses --ttyname not a tty
. It seemstty
viagpg-agent
does not attach tty.