From 0b9e861f9003d041a8c9d7e43394686fc79f42d3 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 2 Feb 2024 14:13:11 -0300 Subject: [PATCH] fix: print prompt to stderr. --- helpers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helpers.go b/helpers.go index 0534f02..9353fa7 100644 --- a/helpers.go +++ b/helpers.go @@ -182,6 +182,7 @@ func promptDecrypt(ncryptsec1 string) (string, error) { func ask(msg string, defaultValue string, shouldAskAgain func(answer string) bool) (string, error) { return _ask(&readline.Config{ + Stdout: os.Stderr, Prompt: color.YellowString(msg), InterruptPrompt: "^C", DisableAutoSaveHistory: true, @@ -190,6 +191,7 @@ func ask(msg string, defaultValue string, shouldAskAgain func(answer string) boo func askPassword(msg string, shouldAskAgain func(answer string) bool) (string, error) { config := &readline.Config{ + Stdout: os.Stderr, Prompt: color.YellowString(msg), InterruptPrompt: "^C", DisableAutoSaveHistory: true,