ext/io/console/console.c in io-console-0.5.2 vs ext/io/console/console.c in io-console-0.5.3
- old
+ new
@@ -21,11 +21,11 @@
typedef struct termios conmode;
static int
setattr(int fd, conmode *t)
{
- while (tcsetattr(fd, TCSAFLUSH, t)) {
+ while (tcsetattr(fd, TCSANOW, t)) {
if (errno != EINTR) return 0;
}
return 1;
}
# define getattr(fd, t) (tcgetattr(fd, t) == 0)
@@ -163,14 +163,16 @@
{
#ifdef HAVE_CFMAKERAW
cfmakeraw(t);
t->c_lflag &= ~(ECHOE|ECHOK);
#elif defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
- t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+ t->c_iflag &= ~(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL);
t->c_oflag &= ~OPOST;
- t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN);
+ t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|XCASE);
t->c_cflag &= ~(CSIZE|PARENB);
t->c_cflag |= CS8;
+ t->c_cc[VMIN] = 1;
+ t->c_cc[VTIME] = 0;
#elif defined HAVE_SGTTY_H
t->sg_flags &= ~ECHO;
t->sg_flags |= RAW;
#elif defined _WIN32
*t = 0;