fix(menu): 队列内改用独立子进程执行,修复交互提示不可见

- 进程内调用 + '| Out-Host' 会让远端 ssh -t 的输出按行缓冲,'请选择分类'
  这类不带换行的提示不会渲染,用户只能盲输(实测被误按 q 取消,归档全被取消)
- 改为 Start-Process -NoNewWindow -Wait,子进程直接继承控制台,提示与
  输入回显恢复正常;退出码取自子进程 ExitCode
- media-archive 取消时返回 2 而不是 0,避免上层把「取消」记成「成功」
- worker 启动日志补充 stdin/stdout 是否被重定向,便于排查同类问题
This commit is contained in:
ali
2026-11-19 18:30:27 +08:00
parent 0e82f054ad
commit eb1aa5600f
2 changed files with 18 additions and 10 deletions
+2 -2
View File
@@ -426,7 +426,7 @@ def main() -> int:
category = choose_category(cats, suggestion)
if not category:
print("已取消。")
return 0
return 2 # 用非 0 退出码,避免上层把「取消」当成「成功」
dest = MEDIA_ROOT / category / src.name
merging = dest.exists() and not args.no_merge
@@ -460,7 +460,7 @@ def main() -> int:
confirm = "n"
if confirm not in {"", "y", "yes"}:
print("已取消。")
return 0
return 2 # 同上:取消不能报成成功
if merging:
rep = merge_into(src, dest)