diff --git a/vendor.conf b/vendor.conf index 8676d22dd..49662b308 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,6 +1,6 @@ github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 github.com/containerd/go-runc 2774a2ea124a5c2d0aba13b5c2dd8a5a9a48775d -github.com/containerd/console 7fed77e673ca4abcd0cbd6d4d0e0e22137cbd778 +github.com/containerd/console 2ce1c681f3c3c0dfa7d0af289428d36567c9a6bc github.com/containerd/cgroups 4fd64a776f25b5540cddcb72eea6e35e58baca6e github.com/docker/go-metrics 8fd5772bf1584597834c6f7961a530f06cbfbb87 github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 diff --git a/vendor/github.com/containerd/console/console.go b/vendor/github.com/containerd/console/console.go index c702a608f..6f1cca966 100644 --- a/vendor/github.com/containerd/console/console.go +++ b/vendor/github.com/containerd/console/console.go @@ -28,6 +28,8 @@ type Console interface { Size() (WinSize, error) // Fd returns the console's file descriptor Fd() uintptr + // Name returns the console's file name + Name() string } // WinSize specifies the window size of the console diff --git a/vendor/github.com/containerd/console/console_linux.go b/vendor/github.com/containerd/console/console_linux.go index b2000d7d8..487ed44c0 100644 --- a/vendor/github.com/containerd/console/console_linux.go +++ b/vendor/github.com/containerd/console/console_linux.go @@ -1,4 +1,5 @@ // +build linux + package console import ( diff --git a/vendor/github.com/containerd/console/console_unix.go b/vendor/github.com/containerd/console/console_unix.go index baf390be4..0bd6b005a 100644 --- a/vendor/github.com/containerd/console/console_unix.go +++ b/vendor/github.com/containerd/console/console_unix.go @@ -118,6 +118,10 @@ func (m *master) Fd() uintptr { return m.f.Fd() } +func (m *master) Name() string { + return m.f.Name() +} + // checkConsole checks if the provided file is a console func checkConsole(f *os.File) error { var termios unix.Termios @@ -132,3 +136,12 @@ func newMaster(f *os.File) Console { f: f, } } + +// SaneTerminal sets the necessary tty_ioctl(4)s to ensure that a pty pair +// created by us acts normally. In particular, a not-very-well-known default of +// Linux unix98 ptys is that they have +onlcr by default. While this isn't a +// problem for terminal emulators, because we relay data from the terminal we +// also relay that funky line discipline. +func SaneTerminal(f *os.File) error { + return saneTerminal(f) +} diff --git a/vendor/github.com/containerd/console/console_windows.go b/vendor/github.com/containerd/console/console_windows.go index af3ea9e0e..2e644cba9 100644 --- a/vendor/github.com/containerd/console/console_windows.go +++ b/vendor/github.com/containerd/console/console_windows.go @@ -154,6 +154,13 @@ func (m *master) Fd() uintptr { return m.in } +// on windows, console can only be made from os.Std{in,out,err}, hence there +// isnt a single name here we can use. Return a dummy "console" value in this +// case should be sufficient. +func (m *master) Name() string { + return "console" +} + // makeInputRaw puts the terminal (Windows Console) connected to the given // file descriptor into raw mode func makeInputRaw(fd uintptr, mode uint32) error {