What happened / 发生了什么
_reboot() 调用 os.execv() 重启,但 Windows 没有 execve。CPython 实际执行 CreateProcessW + _exit():创建新进程后退出旧进程。结果新进程以新 PID 运行,脱离 shell 进程组,导致:
- Shell 回到提示符,终端可继续输入
- Ctrl+C 发给 shell(前台进程组),不发给新进程,无法中断
- 只能手动找 PID 或关终端
Reproduce / 如何复现?
uv run main.py
- 触发重启(如更新)
- Shell 恢复提示符,新进程仍在运行,Ctrl+C 无效
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
git(commit 89ec07a) uv, Windows 11 PowerShell 7
OS
Windows
Logs / 报错日志
Ctrl+C 不能中断

Are you willing to submit a PR? / 你愿意提交 PR 吗?
Code of Conduct
What happened / 发生了什么
_reboot()调用os.execv()重启,但 Windows 没有execve。CPython 实际执行CreateProcessW+_exit():创建新进程后退出旧进程。结果新进程以新 PID 运行,脱离 shell 进程组,导致:Reproduce / 如何复现?
uv run main.pyAstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
git(commit 89ec07a) uv, Windows 11 PowerShell 7
OS
Windows
Logs / 报错日志
Ctrl+C 不能中断

Are you willing to submit a PR? / 你愿意提交 PR 吗?
Code of Conduct