tig icon indicating copy to clipboard operation
tig copied to clipboard

pinentry-curses compatibility

Open slve opened this issue 2 years ago • 1 comments

While pinentry-curses renders properly when trying to preview a commit that contains gpg files, on input the keycodes are passed through down to tig preventing the user to enter their passphrase.

My stable yet very suboptimal workaround for now as follows.

diff --git a/src/display.c b/src/display.c
index b2fe8b9..a6dcf2b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -45,7 +45,7 @@ static struct io script_io = { -1 };
 bool
 is_script_executing(void)
 {
-	return script_io.pipe != -1;
+	return script_io.pipe != -1 || system("pgrep pinentry-curses > /dev/null") == 0;
 }
 
 enum status_code

slve avatar Mar 25 '23 17:03 slve

Have you tried with GPG_TTY environment variable set with export GPG_TTY=$(tty) prior to starting Tig ?

koutcher avatar May 20 '23 15:05 koutcher