@ 261105.1 · fetching

260402.12 · bea6721549ceb25695fc81f375aae2368517c38f

fix(tty): flush input before start (fixes #1045)

reading declarations

Changes to tty/nonblock_bsd.go. All files

tty/nonblock_bsd.go

@@ -41,3 +41,10 @@ func tcSetBufParams(fd int, vMin uint8, vTime uint8) error { 	} 	return nil }++// tcFlushInput discards any queued input before the caller starts reading from+// the tty. This avoids stale bytes, such as delayed mouse reports, from being+// delivered to the next foreground application.+func tcFlushInput(fd int) error {+	return unix.IoctlSetPointerInt(fd, unix.TIOCFLUSH, unix.TCIFLUSH)+}