From 12087c0acd192aa1b7309234da6fc0ef768ddcc8 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 5 Feb 2012 18:26:34 -0500 Subject: [PATCH] Fix CPU usage in interactive mode. Commit 52853a8 tried to fix delays in interative pasting but was the incorrect way of going about it. It seems to be a problem between a UTF-8 terminal and libreadline. Setting the LANG environment variable to something non-UTF8 seems to fix things. --- src/pwmc.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/pwmc.c b/src/pwmc.c index 0739bc8c..9bd545b6 100644 --- a/src/pwmc.c +++ b/src/pwmc.c @@ -629,22 +629,7 @@ static int interactive_hook(void) if (interactive_error) rl_event_hook = NULL; - else { - struct timeval tv = { 0, 0 }; - fd_set rfds; - int n; - - FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); - n = select(STDIN_FILENO+1, &rfds, NULL, NULL, &tv); - - if (n > 0 && FD_ISSET(STDIN_FILENO, &rfds)) - rl_set_keyboard_input_timeout(100000); - else - rl_set_keyboard_input_timeout(1); - } - fcntl(STDIN_FILENO, F_SETFL, 0); return 0; } -- 2.11.4.GIT