mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
Update github.com/moby/term digest to 0564e01
Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
21
vendor/github.com/moby/term/term.go
generated
vendored
21
vendor/github.com/moby/term/term.go
generated
vendored
@@ -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)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user