Allow for - to stand in for stdin/out

This commit is contained in:
Nate Brown
2026-05-07 22:33:14 -05:00
parent 1ada3d4dd9
commit 7c31a8eb35
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
}