From 2d6b58594c283443a20083fef5b664e1c49a00d7 Mon Sep 17 00:00:00 2001 From: Fredrik Salomonsson Date: Sun, 4 Nov 2018 20:19:13 -0800 Subject: Forcing the output --- rofi-pinentry.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'rofi-pinentry.scm') diff --git a/rofi-pinentry.scm b/rofi-pinentry.scm index 89fb2c5..e897262 100755 --- a/rofi-pinentry.scm +++ b/rofi-pinentry.scm @@ -76,7 +76,8 @@ touch-file=/run/user/1000/gnupg/S.gpg-agent" (let ((info (match:substring regex-match 1))) (cond ((string=? info "pid") - (format #t "D ~a\n" (getpid)))))) + (format #t "D ~a\n" (getpid)) + (force-output))))) regex-match)) (define (pinentry-setkeyinfo pinentry line) @@ -115,9 +116,11 @@ touch-file=/run/user/1000/gnupg/S.gpg-agent" (status (close-pipe pipe))) (if status (unless (string-empty? pass) - (format #t "D ~a" pass)) + (format #t "D ~a" pass) + (force-output)) (begin (format #t "ERR 83886179 Operation cancelled \n") + (force-output) (set-pinentry-ok! pinentry #f))))) regex-match)) @@ -139,11 +142,16 @@ touch-file=/run/user/1000/gnupg/S.gpg-agent" ((pinentry-setprompt pinentry line)) ((pinentry-getpin pinentry line)) ((pinentry-bye pinentry line)) - (#t (begin (format #t "BYE\n") (exit #f)))) + (#t (begin + (format #t "BYE\n") + (force-output) + (exit #f)))) (pinentry-loop pinentry input-port)))) (let ((pinentry (make-pinentry #t "Passphrase:" "" #f))) (format #t "OK Please go ahead\n") + (force-output) (pinentry-loop pinentry (current-input-port)) (when (pinentry-ok pinentry) - (format #t "OK\n"))) + (format #t "OK\n") + (force-output))) -- cgit