Skip to content

Commit

Permalink
fix(cursor): 优化 Cursor 关闭逻辑
Browse files Browse the repository at this point in the history
- 在恢复和修改机器 ID 后添加 Cursor 自动关闭逻辑
- 如果 Cursor 无法自动关闭,提示用户手动关闭并重试
- 提高了脚本的健壮性和用户体验
  • Loading branch information
wqjuser committed Feb 4, 2025
1 parent a496fda commit 727e883
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions cursor_pro_keep_alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,25 @@ def inner_restart_cursor():
cursor_path = ""

if choice == 3:
MachineIDResetter().restore_machine_ids()
print("\n文件或设备信息恢复成功,按回车键退出...", end='', flush=True)
input()
sys.exit(0)
success, _ = ExitCursor()
if success:
MachineIDResetter().restore_machine_ids()
print("\n文件或设备信息恢复成功,按回车键退出...", end='', flush=True)
input()
sys.exit(0)
else:
print("Cursor 未能自动关闭,请手动关闭后重试")

elif choice == 2:
MachineIDResetter().reset_machine_ids()
print("\n文件或设备信息修改成功,按回车键退出...", end='', flush=True)
input()
sys.exit(0)
success, _ = ExitCursor()
if success:
MachineIDResetter().reset_machine_ids()
print("\n文件或设备信息修改成功,按回车键退出...", end='', flush=True)
input()
sys.exit(0)
else:
print("Cursor 未能自动关闭,请手动关闭后重试")

# 原有的重置逻辑
browser_manager = None
is_success = False
Expand Down

0 comments on commit 727e883

Please sign in to comment.