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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 34 deletions

2
go.mod
View file

@ -40,7 +40,7 @@ require (
github.com/json-iterator/go v1.1.12
github.com/mattn/go-shellwords v1.0.12
github.com/mattn/go-sqlite3 v1.14.16
github.com/moby/term v0.0.0-20221120202655-abb19827d345
github.com/moby/term v0.0.0-20230430223545-0564e01cfe5d
github.com/nxadm/tail v1.4.8
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.6

6
go.sum
View file

@ -287,7 +287,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 h1:vU+EP9ZuFUCYE0NYLwTSob+3LNEJATzNfP/DC7SWGWI=
github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw=
github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI=
@ -732,8 +732,8 @@ github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
github.com/moby/term v0.0.0-20221120202655-abb19827d345 h1:J9c53/kxIH+2nTKBEfZYFMlhghtHpIHSXpm5VRGHSnU=
github.com/moby/term v0.0.0-20221120202655-abb19827d345/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM=
github.com/moby/term v0.0.0-20230430223545-0564e01cfe5d h1:wvK3QQ7ZMcE/hZOyGmS0o8oxOoHRtZN+RYvV+XpDSIQ=
github.com/moby/term v0.0.0-20230430223545-0564e01cfe5d/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=

4
vendor/github.com/moby/term/tc.go generated vendored
View file

@ -7,7 +7,7 @@ import (
"golang.org/x/sys/unix"
)
func tcget(fd uintptr) (*Termios, error) {
func tcget(fd uintptr) (*unix.Termios, error) {
p, err := unix.IoctlGetTermios(int(fd), getTermios)
if err != nil {
return nil, err
@ -15,6 +15,6 @@ func tcget(fd uintptr) (*Termios, error) {
return p, nil
}
func tcset(fd uintptr, p *Termios) error {
func tcset(fd uintptr, p *unix.Termios) error {
return unix.IoctlSetTermios(int(fd), setTermios, p)
}

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)
}
}()
}

View file

@ -8,6 +8,8 @@ import (
)
// Termios is the Unix API for terminal I/O.
//
// Deprecated: use [unix.Termios].
type Termios = unix.Termios
// MakeRaw puts the terminal connected to the given file descriptor into raw
@ -21,10 +23,10 @@ func MakeRaw(fd uintptr) (*State, error) {
oldState := State{termios: *termios}
termios.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON)
termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON
termios.Oflag &^= unix.OPOST
termios.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)
termios.Cflag &^= (unix.CSIZE | unix.PARENB)
termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN
termios.Cflag &^= unix.CSIZE | unix.PARENB
termios.Cflag |= unix.CS8
termios.Cc[unix.VMIN] = 1
termios.Cc[unix.VTIME] = 0

View file

@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
"strconv"
"strings"
"unsafe"
@ -195,10 +196,10 @@ func keyToString(keyEvent *winterm.KEY_EVENT_RECORD, escapeSequence []byte) stri
// <Alt>+Key generates ESC N Key
if !control && alt {
return ansiterm.KEY_ESC_N + strings.ToLower(string(keyEvent.UnicodeChar))
return ansiterm.KEY_ESC_N + strings.ToLower(strconv.Itoa(int(keyEvent.UnicodeChar)))
}
return string(keyEvent.UnicodeChar)
return strconv.Itoa(int(keyEvent.UnicodeChar))
}
// formatVirtualKey converts a virtual key (e.g., up arrow) into the appropriate ANSI string.

View file

@ -30,8 +30,11 @@ func GetHandleInfo(in interface{}) (uintptr, bool) {
// IsConsole returns true if the given file descriptor is a Windows Console.
// The code assumes that GetConsoleMode will return an error for file descriptors that are not a console.
// Deprecated: use golang.org/x/sys/windows.GetConsoleMode() or golang.org/x/term.IsTerminal()
var IsConsole = isConsole
//
// Deprecated: use [windows.GetConsoleMode] or [golang.org/x/term.IsTerminal].
func IsConsole(fd uintptr) bool {
return isConsole(fd)
}
func isConsole(fd uintptr) bool {
var mode uint32

2
vendor/modules.txt vendored
View file

@ -657,7 +657,7 @@ github.com/moby/sys/mountinfo
# github.com/moby/sys/sequential v0.5.0
## explicit; go 1.17
github.com/moby/sys/sequential
# github.com/moby/term v0.0.0-20221120202655-abb19827d345
# github.com/moby/term v0.0.0-20230430223545-0564e01cfe5d
## explicit; go 1.18
github.com/moby/term
github.com/moby/term/windows