From 750437d5720171f44a0b457a8f2c559536e23440 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 1 Jul 2019 23:01:26 +1000 Subject: [PATCH] bump jesseduffield/rollrus --- Gopkg.lock | 11 +-- vendor/github.com/jesseduffield/pty/License | 23 ------ vendor/github.com/jesseduffield/pty/doc.go | 16 ---- vendor/github.com/jesseduffield/pty/ioctl.go | 13 --- .../github.com/jesseduffield/pty/ioctl_bsd.go | 39 --------- .../jesseduffield/pty/pty_darwin.go | 65 --------------- .../jesseduffield/pty/pty_dragonfly.go | 80 ------------------- .../jesseduffield/pty/pty_freebsd.go | 78 ------------------ .../github.com/jesseduffield/pty/pty_linux.go | 51 ------------ .../jesseduffield/pty/pty_openbsd.go | 33 -------- .../jesseduffield/pty/pty_unsupported.go | 11 --- vendor/github.com/jesseduffield/pty/run.go | 54 ------------- vendor/github.com/jesseduffield/pty/types.go | 10 --- .../jesseduffield/pty/types_dragonfly.go | 17 ---- .../jesseduffield/pty/types_freebsd.go | 15 ---- .../jesseduffield/pty/types_openbsd.go | 14 ---- vendor/github.com/jesseduffield/pty/util.go | 64 --------------- .../jesseduffield/pty/ztypes_386.go | 9 --- .../jesseduffield/pty/ztypes_amd64.go | 9 --- .../jesseduffield/pty/ztypes_arm.go | 9 --- .../jesseduffield/pty/ztypes_arm64.go | 11 --- .../pty/ztypes_dragonfly_amd64.go | 14 ---- .../jesseduffield/pty/ztypes_freebsd_386.go | 13 --- .../jesseduffield/pty/ztypes_freebsd_amd64.go | 14 ---- .../jesseduffield/pty/ztypes_freebsd_arm.go | 13 --- .../jesseduffield/pty/ztypes_mipsx.go | 12 --- .../jesseduffield/pty/ztypes_openbsd_386.go | 13 --- .../jesseduffield/pty/ztypes_openbsd_amd64.go | 13 --- .../jesseduffield/pty/ztypes_ppc64.go | 11 --- .../jesseduffield/pty/ztypes_ppc64le.go | 11 --- .../jesseduffield/pty/ztypes_s390x.go | 11 --- 31 files changed, 1 insertion(+), 756 deletions(-) delete mode 100644 vendor/github.com/jesseduffield/pty/License delete mode 100644 vendor/github.com/jesseduffield/pty/doc.go delete mode 100644 vendor/github.com/jesseduffield/pty/ioctl.go delete mode 100644 vendor/github.com/jesseduffield/pty/ioctl_bsd.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_darwin.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_dragonfly.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_freebsd.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_linux.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_openbsd.go delete mode 100644 vendor/github.com/jesseduffield/pty/pty_unsupported.go delete mode 100644 vendor/github.com/jesseduffield/pty/run.go delete mode 100644 vendor/github.com/jesseduffield/pty/types.go delete mode 100644 vendor/github.com/jesseduffield/pty/types_dragonfly.go delete mode 100644 vendor/github.com/jesseduffield/pty/types_freebsd.go delete mode 100644 vendor/github.com/jesseduffield/pty/types_openbsd.go delete mode 100644 vendor/github.com/jesseduffield/pty/util.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_386.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_amd64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_arm.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_arm64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_dragonfly_amd64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_freebsd_386.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_freebsd_amd64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_freebsd_arm.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_mipsx.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_openbsd_386.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_openbsd_amd64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_ppc64.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_ppc64le.go delete mode 100644 vendor/github.com/jesseduffield/pty/ztypes_s390x.go diff --git a/Gopkg.lock b/Gopkg.lock index 5acb6e3d..e43444ec 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -129,14 +129,6 @@ pruneopts = "NUT" revision = "117e4fb79d29e3908cb7a7bed5e991a321fde7fd" -[[projects]] - branch = "master" - digest = "1:a46c2f4863e5284ddb255c28750298e04bc8c0fc896bed6056e947673168b7be" - name = "github.com/jesseduffield/pty" - packages = ["."] - pruneopts = "NUT" - revision = "02db52c7e406c7abec44c717a173c7715e4c1b62" - [[projects]] branch = "master" digest = "1:7429d1589cc1454e9e97ba48cb7c5025a085b32eae4d3163c517e3e5d6c7a7a0" @@ -151,7 +143,7 @@ name = "github.com/jesseduffield/rollrus" packages = ["."] pruneopts = "NUT" - revision = "7086c0b1b1bd21ef1f502e914ff2505a68c7d638" + revision = "dd028cb0bfd75da456151b389d1a32b68cc57360" [[projects]] branch = "master" @@ -329,7 +321,6 @@ "github.com/imdario/mergo", "github.com/jesseduffield/asciigraph", "github.com/jesseduffield/gocui", - "github.com/jesseduffield/pty", "github.com/jesseduffield/rollrus", "github.com/jesseduffield/yaml", "github.com/mcuadros/go-lookup", diff --git a/vendor/github.com/jesseduffield/pty/License b/vendor/github.com/jesseduffield/pty/License deleted file mode 100644 index 6b7558b6..00000000 --- a/vendor/github.com/jesseduffield/pty/License +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2011 Keith Rarick - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall -be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/jesseduffield/pty/doc.go b/vendor/github.com/jesseduffield/pty/doc.go deleted file mode 100644 index 190cfbea..00000000 --- a/vendor/github.com/jesseduffield/pty/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Package pty provides functions for working with Unix terminals. -package pty - -import ( - "errors" - "os" -) - -// ErrUnsupported is returned if a function is not -// available on the current platform. -var ErrUnsupported = errors.New("unsupported") - -// Opens a pty and its corresponding tty. -func Open() (pty, tty *os.File, err error) { - return open() -} diff --git a/vendor/github.com/jesseduffield/pty/ioctl.go b/vendor/github.com/jesseduffield/pty/ioctl.go deleted file mode 100644 index c57c19e7..00000000 --- a/vendor/github.com/jesseduffield/pty/ioctl.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !windows - -package pty - -import "syscall" - -func ioctl(fd, cmd, ptr uintptr) error { - _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) - if e != 0 { - return e - } - return nil -} diff --git a/vendor/github.com/jesseduffield/pty/ioctl_bsd.go b/vendor/github.com/jesseduffield/pty/ioctl_bsd.go deleted file mode 100644 index 73b12c53..00000000 --- a/vendor/github.com/jesseduffield/pty/ioctl_bsd.go +++ /dev/null @@ -1,39 +0,0 @@ -// +build darwin dragonfly freebsd netbsd openbsd - -package pty - -// from -const ( - _IOC_VOID uintptr = 0x20000000 - _IOC_OUT uintptr = 0x40000000 - _IOC_IN uintptr = 0x80000000 - _IOC_IN_OUT uintptr = _IOC_OUT | _IOC_IN - _IOC_DIRMASK = _IOC_VOID | _IOC_OUT | _IOC_IN - - _IOC_PARAM_SHIFT = 13 - _IOC_PARAM_MASK = (1 << _IOC_PARAM_SHIFT) - 1 -) - -func _IOC_PARM_LEN(ioctl uintptr) uintptr { - return (ioctl >> 16) & _IOC_PARAM_MASK -} - -func _IOC(inout uintptr, group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return inout | (param_len&_IOC_PARAM_MASK)<<16 | uintptr(group)<<8 | ioctl_num -} - -func _IO(group byte, ioctl_num uintptr) uintptr { - return _IOC(_IOC_VOID, group, ioctl_num, 0) -} - -func _IOR(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_OUT, group, ioctl_num, param_len) -} - -func _IOW(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_IN, group, ioctl_num, param_len) -} - -func _IOWR(group byte, ioctl_num uintptr, param_len uintptr) uintptr { - return _IOC(_IOC_IN_OUT, group, ioctl_num, param_len) -} diff --git a/vendor/github.com/jesseduffield/pty/pty_darwin.go b/vendor/github.com/jesseduffield/pty/pty_darwin.go deleted file mode 100644 index 6344b6b0..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_darwin.go +++ /dev/null @@ -1,65 +0,0 @@ -package pty - -import ( - "errors" - "os" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - pFD, err := syscall.Open("/dev/ptmx", syscall.O_RDWR|syscall.O_CLOEXEC, 0) - if err != nil { - return nil, nil, err - } - p := os.NewFile(uintptr(pFD), "/dev/ptmx") - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := grantpt(p); err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func ptsname(f *os.File) (string, error) { - n := make([]byte, _IOC_PARM_LEN(syscall.TIOCPTYGNAME)) - - err := ioctl(f.Fd(), syscall.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0]))) - if err != nil { - return "", err - } - - for i, c := range n { - if c == 0 { - return string(n[:i]), nil - } - } - return "", errors.New("TIOCPTYGNAME string not NUL-terminated") -} - -func grantpt(f *os.File) error { - return ioctl(f.Fd(), syscall.TIOCPTYGRANT, 0) -} - -func unlockpt(f *os.File) error { - return ioctl(f.Fd(), syscall.TIOCPTYUNLK, 0) -} diff --git a/vendor/github.com/jesseduffield/pty/pty_dragonfly.go b/vendor/github.com/jesseduffield/pty/pty_dragonfly.go deleted file mode 100644 index b7d1f20f..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_dragonfly.go +++ /dev/null @@ -1,80 +0,0 @@ -package pty - -import ( - "errors" - "os" - "strings" - "syscall" - "unsafe" -) - -// same code as pty_darwin.go -func open() (pty, tty *os.File, err error) { - p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := grantpt(p); err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func grantpt(f *os.File) error { - _, err := isptmaster(f.Fd()) - return err -} - -func unlockpt(f *os.File) error { - _, err := isptmaster(f.Fd()) - return err -} - -func isptmaster(fd uintptr) (bool, error) { - err := ioctl(fd, syscall.TIOCISPTMASTER, 0) - return err == nil, err -} - -var ( - emptyFiodgnameArg fiodgnameArg - ioctl_FIODNAME = _IOW('f', 120, unsafe.Sizeof(emptyFiodgnameArg)) -) - -func ptsname(f *os.File) (string, error) { - name := make([]byte, _C_SPECNAMELEN) - fa := fiodgnameArg{Name: (*byte)(unsafe.Pointer(&name[0])), Len: _C_SPECNAMELEN, Pad_cgo_0: [4]byte{0, 0, 0, 0}} - - err := ioctl(f.Fd(), ioctl_FIODNAME, uintptr(unsafe.Pointer(&fa))) - if err != nil { - return "", err - } - - for i, c := range name { - if c == 0 { - s := "/dev/" + string(name[:i]) - return strings.Replace(s, "ptm", "pts", -1), nil - } - } - return "", errors.New("TIOCPTYGNAME string not NUL-terminated") -} diff --git a/vendor/github.com/jesseduffield/pty/pty_freebsd.go b/vendor/github.com/jesseduffield/pty/pty_freebsd.go deleted file mode 100644 index 63b6d913..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_freebsd.go +++ /dev/null @@ -1,78 +0,0 @@ -package pty - -import ( - "errors" - "os" - "syscall" - "unsafe" -) - -func posixOpenpt(oflag int) (fd int, err error) { - r0, _, e1 := syscall.Syscall(syscall.SYS_POSIX_OPENPT, uintptr(oflag), 0, 0) - fd = int(r0) - if e1 != 0 { - err = e1 - } - return fd, err -} - -func open() (pty, tty *os.File, err error) { - fd, err := posixOpenpt(syscall.O_RDWR | syscall.O_CLOEXEC) - if err != nil { - return nil, nil, err - } - p := os.NewFile(uintptr(fd), "/dev/pts") - // In case of error after this point, make sure we close the pts fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - t, err := os.OpenFile("/dev/"+sname, os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func isptmaster(fd uintptr) (bool, error) { - err := ioctl(fd, syscall.TIOCPTMASTER, 0) - return err == nil, err -} - -var ( - emptyFiodgnameArg fiodgnameArg - ioctlFIODGNAME = _IOW('f', 120, unsafe.Sizeof(emptyFiodgnameArg)) -) - -func ptsname(f *os.File) (string, error) { - master, err := isptmaster(f.Fd()) - if err != nil { - return "", err - } - if !master { - return "", syscall.EINVAL - } - - const n = _C_SPECNAMELEN + 1 - var ( - buf = make([]byte, n) - arg = fiodgnameArg{Len: n, Buf: (*byte)(unsafe.Pointer(&buf[0]))} - ) - if err := ioctl(f.Fd(), ioctlFIODGNAME, uintptr(unsafe.Pointer(&arg))); err != nil { - return "", err - } - - for i, c := range buf { - if c == 0 { - return string(buf[:i]), nil - } - } - return "", errors.New("FIODGNAME string not NUL-terminated") -} diff --git a/vendor/github.com/jesseduffield/pty/pty_linux.go b/vendor/github.com/jesseduffield/pty/pty_linux.go deleted file mode 100644 index 296dd212..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_linux.go +++ /dev/null @@ -1,51 +0,0 @@ -package pty - -import ( - "os" - "strconv" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) - if err != nil { - return nil, nil, err - } - // In case of error after this point, make sure we close the ptmx fd. - defer func() { - if err != nil { - _ = p.Close() // Best effort. - } - }() - - sname, err := ptsname(p) - if err != nil { - return nil, nil, err - } - - if err := unlockpt(p); err != nil { - return nil, nil, err - } - - t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) - if err != nil { - return nil, nil, err - } - return p, t, nil -} - -func ptsname(f *os.File) (string, error) { - var n _C_uint - err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) - if err != nil { - return "", err - } - return "/dev/pts/" + strconv.Itoa(int(n)), nil -} - -func unlockpt(f *os.File) error { - var u _C_int - // use TIOCSPTLCK with a zero valued arg to clear the slave pty lock - return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) -} diff --git a/vendor/github.com/jesseduffield/pty/pty_openbsd.go b/vendor/github.com/jesseduffield/pty/pty_openbsd.go deleted file mode 100644 index 6e7aeae7..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_openbsd.go +++ /dev/null @@ -1,33 +0,0 @@ -package pty - -import ( - "os" - "syscall" - "unsafe" -) - -func open() (pty, tty *os.File, err error) { - /* - * from ptm(4): - * The PTMGET command allocates a free pseudo terminal, changes its - * ownership to the caller, revokes the access privileges for all previous - * users, opens the file descriptors for the master and slave devices and - * returns them to the caller in struct ptmget. - */ - - p, err := os.OpenFile("/dev/ptm", os.O_RDWR|syscall.O_CLOEXEC, 0) - if err != nil { - return nil, nil, err - } - defer p.Close() - - var ptm ptmget - if err := ioctl(p.Fd(), uintptr(ioctl_PTMGET), uintptr(unsafe.Pointer(&ptm))); err != nil { - return nil, nil, err - } - - pty = os.NewFile(uintptr(ptm.Cfd), "/dev/ptm") - tty = os.NewFile(uintptr(ptm.Sfd), "/dev/ptm") - - return pty, tty, nil -} diff --git a/vendor/github.com/jesseduffield/pty/pty_unsupported.go b/vendor/github.com/jesseduffield/pty/pty_unsupported.go deleted file mode 100644 index 9a3e721b..00000000 --- a/vendor/github.com/jesseduffield/pty/pty_unsupported.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !linux,!darwin,!freebsd,!dragonfly,!openbsd - -package pty - -import ( - "os" -) - -func open() (pty, tty *os.File, err error) { - return nil, nil, ErrUnsupported -} diff --git a/vendor/github.com/jesseduffield/pty/run.go b/vendor/github.com/jesseduffield/pty/run.go deleted file mode 100644 index dda19b76..00000000 --- a/vendor/github.com/jesseduffield/pty/run.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build !windows - -package pty - -import ( - "os" - "os/exec" - "syscall" -) - -// Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, -// and c.Stderr, calls c.Start, and returns the File of the tty's -// corresponding pty. -func Start(c *exec.Cmd) (pty *os.File, err error) { - return StartWithSize(c, nil) -} - -// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, -// and c.Stderr, calls c.Start, and returns the File of the tty's -// corresponding pty. -// -// This will resize the pty to the specified size before starting the command -func StartWithSize(c *exec.Cmd, sz *Winsize) (pty *os.File, err error) { - pty, tty, err := Open() - if err != nil { - return nil, err - } - defer tty.Close() - if sz != nil { - err = Setsize(pty, sz) - if err != nil { - pty.Close() - return nil, err - } - } - if c.Stdout == nil { - c.Stdout = tty - } - if c.Stderr == nil { - c.Stderr = tty - } - c.Stdin = tty - if c.SysProcAttr == nil { - c.SysProcAttr = &syscall.SysProcAttr{} - } - c.SysProcAttr.Setctty = true - c.SysProcAttr.Setsid = true - err = c.Start() - if err != nil { - pty.Close() - return nil, err - } - return pty, err -} diff --git a/vendor/github.com/jesseduffield/pty/types.go b/vendor/github.com/jesseduffield/pty/types.go deleted file mode 100644 index 5aecb6bc..00000000 --- a/vendor/github.com/jesseduffield/pty/types.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build ignore - -package pty - -import "C" - -type ( - _C_int C.int - _C_uint C.uint -) diff --git a/vendor/github.com/jesseduffield/pty/types_dragonfly.go b/vendor/github.com/jesseduffield/pty/types_dragonfly.go deleted file mode 100644 index 5c0493b8..00000000 --- a/vendor/github.com/jesseduffield/pty/types_dragonfly.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build ignore - -package pty - -/* -#define _KERNEL -#include -#include -#include -*/ -import "C" - -const ( - _C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */ -) - -type fiodgnameArg C.struct_fiodname_args diff --git a/vendor/github.com/jesseduffield/pty/types_freebsd.go b/vendor/github.com/jesseduffield/pty/types_freebsd.go deleted file mode 100644 index ce3eb951..00000000 --- a/vendor/github.com/jesseduffield/pty/types_freebsd.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build ignore - -package pty - -/* -#include -#include -*/ -import "C" - -const ( - _C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */ -) - -type fiodgnameArg C.struct_fiodgname_arg diff --git a/vendor/github.com/jesseduffield/pty/types_openbsd.go b/vendor/github.com/jesseduffield/pty/types_openbsd.go deleted file mode 100644 index 47701b5f..00000000 --- a/vendor/github.com/jesseduffield/pty/types_openbsd.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build ignore - -package pty - -/* -#include -#include -#include -*/ -import "C" - -type ptmget C.struct_ptmget - -var ioctl_PTMGET = C.PTMGET diff --git a/vendor/github.com/jesseduffield/pty/util.go b/vendor/github.com/jesseduffield/pty/util.go deleted file mode 100644 index 68a8584c..00000000 --- a/vendor/github.com/jesseduffield/pty/util.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build !windows - -package pty - -import ( - "os" - "syscall" - "unsafe" -) - -// InheritSize applies the terminal size of master to slave. This should be run -// in a signal handler for syscall.SIGWINCH to automatically resize the slave when -// the master receives a window size change notification. -func InheritSize(master, slave *os.File) error { - size, err := GetsizeFull(master) - if err != nil { - return err - } - err = Setsize(slave, size) - if err != nil { - return err - } - return nil -} - -// Setsize resizes t to s. -func Setsize(t *os.File, ws *Winsize) error { - return windowRectCall(ws, t.Fd(), syscall.TIOCSWINSZ) -} - -// GetsizeFull returns the full terminal size description. -func GetsizeFull(t *os.File) (size *Winsize, err error) { - var ws Winsize - err = windowRectCall(&ws, t.Fd(), syscall.TIOCGWINSZ) - return &ws, err -} - -// Getsize returns the number of rows (lines) and cols (positions -// in each line) in terminal t. -func Getsize(t *os.File) (rows, cols int, err error) { - ws, err := GetsizeFull(t) - return int(ws.Rows), int(ws.Cols), err -} - -// Winsize describes the terminal size. -type Winsize struct { - Rows uint16 // ws_row: Number of rows (in cells) - Cols uint16 // ws_col: Number of columns (in cells) - X uint16 // ws_xpixel: Width in pixels - Y uint16 // ws_ypixel: Height in pixels -} - -func windowRectCall(ws *Winsize, fd, a2 uintptr) error { - _, _, errno := syscall.Syscall( - syscall.SYS_IOCTL, - fd, - a2, - uintptr(unsafe.Pointer(ws)), - ) - if errno != 0 { - return syscall.Errno(errno) - } - return nil -} diff --git a/vendor/github.com/jesseduffield/pty/ztypes_386.go b/vendor/github.com/jesseduffield/pty/ztypes_386.go deleted file mode 100644 index ff0b8fd8..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_386.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_amd64.go b/vendor/github.com/jesseduffield/pty/ztypes_amd64.go deleted file mode 100644 index ff0b8fd8..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_amd64.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_arm.go b/vendor/github.com/jesseduffield/pty/ztypes_arm.go deleted file mode 100644 index ff0b8fd8..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_arm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_arm64.go b/vendor/github.com/jesseduffield/pty/ztypes_arm64.go deleted file mode 100644 index 6c29a4b9..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_arm64.go +++ /dev/null @@ -1,11 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -// +build arm64 - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_dragonfly_amd64.go b/vendor/github.com/jesseduffield/pty/ztypes_dragonfly_amd64.go deleted file mode 100644 index 6b0ba037..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_dragonfly_amd64.go +++ /dev/null @@ -1,14 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_dragonfly.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Name *byte - Len uint32 - Pad_cgo_0 [4]byte -} diff --git a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_386.go b/vendor/github.com/jesseduffield/pty/ztypes_freebsd_386.go deleted file mode 100644 index d9975374..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_386.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Buf *byte -} diff --git a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_amd64.go b/vendor/github.com/jesseduffield/pty/ztypes_freebsd_amd64.go deleted file mode 100644 index 5fa102fc..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_amd64.go +++ /dev/null @@ -1,14 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Pad_cgo_0 [4]byte - Buf *byte -} diff --git a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_arm.go b/vendor/github.com/jesseduffield/pty/ztypes_freebsd_arm.go deleted file mode 100644 index d9975374..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_freebsd_arm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_freebsd.go - -package pty - -const ( - _C_SPECNAMELEN = 0x3f -) - -type fiodgnameArg struct { - Len int32 - Buf *byte -} diff --git a/vendor/github.com/jesseduffield/pty/ztypes_mipsx.go b/vendor/github.com/jesseduffield/pty/ztypes_mipsx.go deleted file mode 100644 index f0ce7408..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_mipsx.go +++ /dev/null @@ -1,12 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -// +build linux -// +build mips mipsle mips64 mips64le - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_openbsd_386.go b/vendor/github.com/jesseduffield/pty/ztypes_openbsd_386.go deleted file mode 100644 index ccb3aab9..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_openbsd_386.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_openbsd.go - -package pty - -type ptmget struct { - Cfd int32 - Sfd int32 - Cn [16]int8 - Sn [16]int8 -} - -var ioctl_PTMGET = 0x40287401 diff --git a/vendor/github.com/jesseduffield/pty/ztypes_openbsd_amd64.go b/vendor/github.com/jesseduffield/pty/ztypes_openbsd_amd64.go deleted file mode 100644 index e6705168..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_openbsd_amd64.go +++ /dev/null @@ -1,13 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_openbsd.go - -package pty - -type ptmget struct { - Cfd int32 - Sfd int32 - Cn [16]int8 - Sn [16]int8 -} - -var ioctl_PTMGET = 0x40287401 diff --git a/vendor/github.com/jesseduffield/pty/ztypes_ppc64.go b/vendor/github.com/jesseduffield/pty/ztypes_ppc64.go deleted file mode 100644 index 4e1af843..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_ppc64.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build ppc64 - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_ppc64le.go b/vendor/github.com/jesseduffield/pty/ztypes_ppc64le.go deleted file mode 100644 index e6780f4e..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_ppc64le.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build ppc64le - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -) diff --git a/vendor/github.com/jesseduffield/pty/ztypes_s390x.go b/vendor/github.com/jesseduffield/pty/ztypes_s390x.go deleted file mode 100644 index a7452b61..00000000 --- a/vendor/github.com/jesseduffield/pty/ztypes_s390x.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build s390x - -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types.go - -package pty - -type ( - _C_int int32 - _C_uint uint32 -)