Merge pull request #34386 from tklauser/pkg-term-makeraw-fix

pkg/term: set termios VMIN and VTIME in MakeRaw on Linux
This commit is contained in:
Kenfe-Mickaël Laventure 2017-08-07 16:34:40 +02:00 committed by GitHub
commit 6f1907898f
1 changed files with 2 additions and 0 deletions

View File

@ -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