- run_supervisor 捕获 KeyboardInterrupt:不打 traceback、退出码归零, 给子进程 _GRACE_SECONDS=5s 自行收尾窗口(打退出日志、关连接), 超时才 taskkill /F /T;文件变更重启仍立即强杀(子进程不知情不会自己退) - main() 兜底监督循环间隙的 Ctrl+C - start.bat 改为发射器:start 新开独立控制台跑 cmd /c 命令行(非批 处理),Ctrl+C 直接停进程,规避「终止批处理操作吗(Y/N)」,发射器 即退;bat 保持纯 ASCII 防 GBK 乱码
6 lines
277 B
Batchfile
6 lines
277 B
Batchfile
@echo off
|
|
rem Run the bot in its own console: cmd /c executes a command line, not a
|
|
rem batch, so Ctrl+C shuts it down cleanly without cmd's
|
|
rem "Terminate batch job (Y/N)?" prompt. This launcher exits immediately.
|
|
start "musicbot" /d "%~dp0" cmd /c "uv run musicbot --reload"
|