From 6da2e66ef9ce27a85af56d9cee07d0aeb952eea4 Mon Sep 17 00:00:00 2001 From: Jenz Guenther Date: Mon, 31 Jul 2017 12:01:35 +0200 Subject: [PATCH] Ensure blocking read in noncanonical mode --- pick.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pick.c b/pick.c index 76c37669..63271637 100644 --- a/pick.c +++ b/pick.c @@ -644,6 +644,8 @@ tty_init(void) new_attributes = original_attributes; new_attributes.c_iflag |= ICRNL; /* map CR to NL */ new_attributes.c_lflag &= ~(ECHO | ICANON | IEXTEN); + new_attributes.c_cc[VMIN] = 1; + new_attributes.c_cc[VTIME] = 0; tcsetattr(fileno(tty_in), TCSANOW, &new_attributes); if ((tty_out = fopen("/dev/tty", "w")) == NULL)