Update github.com/moby/term digest to 0564e01

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-05-01 09:44:21 +00:00
committed by GitHub
parent 0429b6816b
commit 202701e653
8 changed files with 21 additions and 34 deletions

21
vendor/github.com/moby/term/term.go generated vendored
View File

@@ -7,10 +7,8 @@ package term
import (
"errors"
"fmt"
"io"
"os"
"os/signal"
"golang.org/x/sys/unix"
)
@@ -20,7 +18,7 @@ var ErrInvalidState = errors.New("Invalid terminal state")
// State represents the state of the terminal.
type State struct {
termios Termios
termios unix.Termios
}
// Winsize represents the size of the terminal window.
@@ -80,7 +78,6 @@ func DisableEcho(fd uintptr, state *State) error {
if err := tcset(fd, &newState); err != nil {
return err
}
handleInterrupt(fd, state)
return nil
}
@@ -92,7 +89,6 @@ func SetRawTerminal(fd uintptr) (*State, error) {
if err != nil {
return nil, err
}
handleInterrupt(fd, oldState)
return oldState, err
}
@@ -102,18 +98,3 @@ func SetRawTerminal(fd uintptr) (*State, error) {
func SetRawTerminalOutput(fd uintptr) (*State, error) {
return nil, nil
}
func handleInterrupt(fd uintptr, state *State) {
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, os.Interrupt)
go func() {
for range sigchan {
// quit cleanly and the new terminal item is on a new line
fmt.Println()
signal.Stop(sigchan)
close(sigchan)
RestoreTerminal(fd, state)
os.Exit(1)
}
}()
}