Allow for - to stand in for stdin/out (#1714)

This commit is contained in:
Nate Brown
2026-05-15 15:36:08 -05:00
committed by GitHub
parent 6c7ebb0875
commit 3c121e7ab1
13 changed files with 718 additions and 57 deletions

View File

@@ -22,7 +22,9 @@ func (pr StdinPasswordReader) ReadPassword() ([]byte, error) {
}
password, err := term.ReadPassword(int(os.Stdin.Fd()))
fmt.Println()
// Terminal echo is off while reading, so the user's Enter key does not
// produce a visible newline. Emit one on stderr to match the prompt.
fmt.Fprintln(os.Stderr)
return password, err
}