From 5497217018d05a8146ccdca20ef101675c0afb65 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Feb 2025 20:54:18 +0100 Subject: [PATCH] print password from stdin message only to terminal --- cmd/restic/global.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index bea09837f..2d65c4983 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -370,7 +370,9 @@ func ReadPassword(ctx context.Context, opts GlobalOptions, prompt string) (strin password, err = readPasswordTerminal(ctx, os.Stdin, os.Stderr, prompt) } else { password, err = readPassword(os.Stdin) - Verbosef("reading repository password from stdin\n") + if stdoutIsTerminal() { + Verbosef("reading repository password from stdin\n") + } } if err != nil {