mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
7.19k stars 340 forks source link

interp: add -s support for read builtin #1063

Closed davidhulick closed 1 month ago

davidhulick commented 7 months ago

This implements the -s option for the read builtin using the ReadPassword function in the golang.org/x/term package. This is a less featureful (and as a result, simpler) implementation of the -s flag than is present in https://github.com/mvdan/sh/pull/865

Like PR865, I am also unsure of how to test the -s flag since it requires interacting with the terminal input.