diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 3e1a4c6b..85785f9a 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -5,6 +5,7 @@ #include "keys.hh" #include "ranges.hh" #include "string_utils.hh" +#include "file.hh" #include @@ -579,7 +580,7 @@ Optional NCursesUI::get_next_key() static auto get_char = []() -> Optional { unsigned char c = 0; - if (read(STDIN_FILENO, &c, 1) == 1) + if (fd_readable(STDIN_FILENO) and read(STDIN_FILENO, &c, 1) == 1) return c; return {}; };