mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit v0.21.0-rc1
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
9
vendor/golang.org/x/term/terminal.go
generated
vendored
9
vendor/golang.org/x/term/terminal.go
generated
vendored
@ -44,6 +44,8 @@ type Terminal struct {
|
||||
// bytes, as an index into |line|). If it returns ok=false, the key
|
||||
// press is processed normally. Otherwise it returns a replacement line
|
||||
// and the new cursor position.
|
||||
//
|
||||
// This will be disabled during ReadPassword.
|
||||
AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool)
|
||||
|
||||
// Escape contains a pointer to the escape codes for this terminal.
|
||||
@ -692,6 +694,8 @@ func (t *Terminal) Write(buf []byte) (n int, err error) {
|
||||
|
||||
// ReadPassword temporarily changes the prompt and reads a password, without
|
||||
// echo, from the terminal.
|
||||
//
|
||||
// The AutoCompleteCallback is disabled during this call.
|
||||
func (t *Terminal) ReadPassword(prompt string) (line string, err error) {
|
||||
t.lock.Lock()
|
||||
defer t.lock.Unlock()
|
||||
@ -699,6 +703,11 @@ func (t *Terminal) ReadPassword(prompt string) (line string, err error) {
|
||||
oldPrompt := t.prompt
|
||||
t.prompt = []rune(prompt)
|
||||
t.echo = false
|
||||
oldAutoCompleteCallback := t.AutoCompleteCallback
|
||||
t.AutoCompleteCallback = nil
|
||||
defer func() {
|
||||
t.AutoCompleteCallback = oldAutoCompleteCallback
|
||||
}()
|
||||
|
||||
line, err = t.readLine()
|
||||
|
||||
|
Reference in New Issue
Block a user