From d7562ba640e30ac4bf1160509f4c2f705363d53f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 25 Mar 2013 02:14:06 +0000 Subject: [PATCH] gui: Check stdin for readability. If the select_loop of para_gui runs in getch or command mode we currently wait a full timeout period before checking for pending input. This patch adds stdin to the set of file descriptors monitored by select so that a key press causes select() to return immediately. --- gui.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui.c b/gui.c index 728fb9b7..9ac24ab6 100644 --- a/gui.c +++ b/gui.c @@ -993,6 +993,8 @@ repeat: if (command_fds[1] >= 0) para_fd_set(command_fds[1], &rfds, &max_fileno); } + if (mode == GETCH_MODE || mode == COMMAND_MODE) + para_fd_set(STDIN_FILENO, &rfds, &max_fileno); ret = para_select(max_fileno + 1, &rfds, NULL, &tv); if (ret <= 0) goto check_return; /* skip fd checks */ -- 2.39.2