From 52493ab8ec6815c44860ef4abce5f840fb4f9ce6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 12:38:49 +0000 Subject: [PATCH] Fix quick-setup token prompt in piped mode Read token from /dev/tty when stdin is non-interactive so curl|bash setup can still prompt for COPILOT_GITHUB_TOKEN. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- scripts/quick-setup.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/quick-setup.sh b/scripts/quick-setup.sh index f30ed344..7976c935 100755 --- a/scripts/quick-setup.sh +++ b/scripts/quick-setup.sh @@ -220,7 +220,7 @@ if [ "$skip_secret" = false ]; then echo "dry-run: open $token_url" echo "dry-run: prompt for token" echo "dry-run: printf '%s' \"(token)\" | gh secret set COPILOT_GITHUB_TOKEN --repo $repo" - elif [ -t 0 ]; then + elif [ -t 0 ] || [ -r /dev/tty ]; then echo "A fine-grained PAT with the 'Copilot requests' permission is needed." echo "Opening browser to create one..." if command -v open >/dev/null 2>&1; then @@ -230,9 +230,15 @@ if [ "$skip_secret" = false ]; then else echo "Visit: $token_url" fi - printf "Paste the token here: " - read -r -s token - echo + if [ -t 0 ]; then + printf "Paste the token here: " + read -r -s token + echo + else + printf "Paste the token here: " >/dev/tty + IFS= read -r -s token /dev/tty + fi if [ -z "$token" ]; then echo "No token provided. Use --skip-secret to set it manually later." >&2 exit 1