jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.28k stars 604 forks source link

pinentry-curses compatibility #1274

Closed slve closed 3 months ago

slve commented 1 year ago

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
koutcher commented 1 year ago

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