fix(cli): block on getch() to avoid background menu refreshing and viewport snapping during scroll

This commit is contained in:
baoweise
2026-05-28 22:38:58 +08:00
parent 174b5b7d2a
commit 4ebe42e4ce
+2 -5
View File
@@ -678,7 +678,7 @@ def main():
print_status() print_status()
print("\n提示: 正在实时监控状态,自动更新。按 Ctrl+C 退出...") print("\n提示: 正在实时监控状态,自动更新。按 Ctrl+C 退出...")
last_state = current_state last_state = current_state
time.sleep(0.5) time.sleep(2.0)
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass
elif cmd == "logs": elif cmd == "logs":
@@ -733,13 +733,10 @@ def main():
last_state = current_state last_state = current_state
try: try:
key = getch_timeout(0.5) key = getch()
except KeyboardInterrupt: except KeyboardInterrupt:
break break
if key is None:
continue
if key == '\x03': if key == '\x03':
break break