浏览代码

Sync: 2026-08-01 12:35:04

Gabriel Capella 1 天之前
父节点
当前提交
b0e3b45b5e
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      start

+ 8 - 3
start

@@ -574,9 +574,14 @@ EOF
             fi
             log_info "Installing $(echo "$missing" | wc -l) missing package(s):"
             echo "$missing" | sed 's/^/  /'
-            # Pass targets as arguments rather than piping to stdin: yay opens
-            # /dev/tty for its prompts, and feeding it stdin breaks that.
-            echo "$missing" | xargs -r yay -S --needed
+            # Build an argv array and invoke yay directly -- no pipe, no xargs.
+            # yay is interactive (cleanBuild, conflict and diff prompts), so it
+            # needs to inherit the terminal's stdin. Piping to it steals stdin;
+            # xargs is worse, because it points the child's stdin at /dev/null
+            # and every prompt immediately reads EOF.
+            local -a pkgs
+            mapfile -t pkgs <<< "$missing"
+            yay -S --needed "${pkgs[@]}"
             ;;
         diff)
             if [[ -n "$missing" ]]; then