I've determined that this is happening as a result of a threading issue (which is part of the reason why it's occasional, and rather difficult to consistently reproduce the behavior).
I've found that the curses input is occasionally being run twice. First in the main thread, where it is supposed to, and unintentionally in the daemon status_loop thread. See bellow:
What is presumably happening is that the condition not pause_updates is met in the status loop, a context switch happens, the main thread resumes, sets pause_updates to true, activates the search dialog, when the status_loop thread resumes (considering the condition has been met) it renders dialog again and thus two inputs are active.
The fix might be what you want. I've tested it a bit and it seems to work OK. I've separated out the api call, since its non-critical and might take longer to run, from the thread lock section since it would likely inhibit performance.
Hi ceuk. I've been looking at issue #14 today.
I've determined that this is happening as a result of a threading issue (which is part of the reason why it's occasional, and rather difficult to consistently reproduce the behavior).
I've found that the curses input is occasionally being run twice. First in the main thread, where it is supposed to, and unintentionally in the daemon status_loop thread. See bellow:
What is presumably happening is that the condition not pause_updates is met in the status loop, a context switch happens, the main thread resumes, sets pause_updates to true, activates the search dialog, when the status_loop thread resumes (considering the condition has been met) it renders dialog again and thus two inputs are active.
The fix might be what you want. I've tested it a bit and it seems to work OK. I've separated out the api call, since its non-critical and might take longer to run, from the thread lock section since it would likely inhibit performance.