From fd944ce735a90b12fc69c42d2ae579508a1c10d8 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 3 Aug 2017 13:18:29 +0200 Subject: [PATCH] pkg/term: set termios VMIN and VTIME in MakeRaw on Linux The BSD and Solaris versions of term.MakeRaw already set VMIN and VTIME explicitly such that a read returns when one character is available. cfmakeraw (which was previously used) in glibc also sets these values explicitly, so it should be done in the Linux version of MakeRaw as well to be consistent. Signed-off-by: Tobias Klauser Upstream-commit: 8a3730d251f844a55244d42c2dae0af8904e07c1 Component: engine --- components/engine/pkg/term/termios_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/engine/pkg/term/termios_linux.go b/components/engine/pkg/term/termios_linux.go index 3e25eb7a41..0f21abcc2f 100644 --- a/components/engine/pkg/term/termios_linux.go +++ b/components/engine/pkg/term/termios_linux.go @@ -29,6 +29,8 @@ func MakeRaw(fd uintptr) (*State, error) { 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 if err := unix.IoctlSetTermios(int(fd), setTermios, termios); err != nil { return nil, err