diff --git a/cmd/restic/main.go b/cmd/restic/main.go index f5c39f5e3..b413dcb41 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -40,12 +40,12 @@ func readPassword(env string, prompt string) string { } } - fmt.Print(prompt) + fmt.Fprint(os.Stderr, prompt) pw, err := terminal.ReadPassword(int(os.Stdin.Fd())) if err != nil { errx(2, "unable to read password: %v", err) } - fmt.Println() + fmt.Fprintln(os.Stderr) return string(pw) }