fix: Disable key debounce for text input entry and typing

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-03-04 17:03:58 -07:00
parent c58a356c02
commit 17e3ad347a
2 changed files with 28 additions and 2 deletions

View File

@@ -45,13 +45,14 @@ def main_loop(stdscr):
while True:
c = stdscr.getch()
if c != curses.ERR:
current_screen = screens[state.current_screen]
# Rate limit key presses unless in a text input field
if not screens[state.current_screen].is_typing and time.time() < state.last_key_time + 1:
if not current_screen.is_typing and not current_screen.is_entry_key(c) and time.time() < state.last_key_time + 1:
pass # Key press ignored due to rate limit
else:
state.c = c
state.last_key_time = time.time()
screens[state.current_screen].handle_input(c)
current_screen.handle_input(c)
if state.current_screen != state.prev_screen:
logging.info('Switching to screen: %s', state.current_screen)