mirror of
https://github.com/baoweise-bot/aimili-vpngate.git
synced 2026-09-07 00:36:49 +08:00
fix(cli): block on getch() to avoid background menu refreshing and viewport snapping during scroll
This commit is contained in:
+2
-5
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user