Skip to content

Update Linux setup scripts to allow Enter key as default confirmation (Y) #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 2, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 1, 2025

The Linux setup scripts (setup.sh and setup-beta.sh) previously required users to explicitly type y to confirm installation steps. This PR updates both scripts to use Y as the default value, allowing users to simply press Enter to confirm, which improves usability and aligns with common CLI conventions.

Changes Made

Before:

read -p "Continue (y/n)? " -n1 -r response
if [[ "$response" != [yY] ]]; then
    echo -e "\nExiting"
    exit 1
fi

After:

read -p "Continue (Y/n)? " -r response  
if [[ "$response" = [nN] ]]; then
    echo -e "\nExiting"
    exit 1
fi

Key Improvements:

  1. Prompt Updated: Changed from (y/n)? to (Y/n)? to clearly indicate Y is the default
  2. Enter Key Support: Removed -n1 flag to allow Enter key input (reads full line instead of single character)
  3. Default Logic: Changed from rejecting non-Y responses to only rejecting explicit N responses
  4. Better UX: Empty input (Enter key) now defaults to 'Yes', following standard CLI patterns

Behavior:

  • Enter key → Continue (default to Yes)
  • 'y' or 'Y' → Continue
  • 'n' or 'N' → Exit
  • Other input → Continue (graceful default to Yes)
  • Non-interactive mode → Continue (unchanged behavior)

This change makes the setup process more user-friendly while maintaining backward compatibility and follows the same pattern used in other scripts like trust-cert.sh.

Fixes #1288.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://github.com/api/repos/dotnet/dev-proxy/releases/latest
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Update Linux setup script to allow Enter key as default confirmation (Y) Update Linux setup scripts to allow Enter key as default confirmation (Y) Jul 1, 2025
Copilot finished work on behalf of waldekmastykarz July 1, 2025 08:01
@Copilot Copilot AI requested a review from waldekmastykarz July 1, 2025 08:01
Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the logic so that the script continues only on y, Y or Enter but not on anything else.

Copy link
Contributor Author

Copilot AI commented Jul 1, 2025

Update the logic so that the script continues only on y, Y or Enter but not on anything else.

Updated the logic to only continue on y, Y, or Enter. Any other input (including n, N, or text like "yes", "no") will now exit the script. Fixed in commit 3545a38.

@Copilot Copilot AI requested a review from waldekmastykarz July 1, 2025 11:27
Copilot finished work on behalf of waldekmastykarz July 1, 2025 11:27
Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Now also update the PowerShell version of the Linux setup script in setup.ps1 and setup-beta.ps1

Copy link
Contributor Author

Copilot AI commented Jul 2, 2025

Perfect. Now also update the PowerShell version of the Linux setup script in setup.ps1 and setup-beta.ps1

Updated the PowerShell setup scripts (setup.ps1 and setup-beta.ps1) with the same logic - they now accept Enter key as default 'Y', and only exit on explicit 'n' or 'N' responses. Fixed in commit 697d821.

Copilot finished work on behalf of waldekmastykarz July 2, 2025 07:12
@Copilot Copilot AI requested a review from waldekmastykarz July 2, 2025 07:12
Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update all scripts so that:

  • pressing Y, y or Enter continues installation
  • pressing anything else cancels it
  • there's no need to confirm the key with an enter (eg. Y + Enter), just press one key

Copy link
Contributor Author

Copilot AI commented Jul 2, 2025

Update all scripts so that:

  • pressing Y, y or Enter continues installation...

Updated all setup scripts to require single key press only:

  • Bash scripts (setup.sh, setup-beta.sh): Now use -n1 flag to read single character and only accept Y, y, or Enter
  • PowerShell scripts (setup.ps1, setup-beta.ps1): Now use [Console]::ReadKey($true) for single key input and only accept Y, y, or Enter
  • Any other key (including n, N, or text) will cancel installation
  • No need to press Enter after Y/y - just single key press

Fixed in commit 4842174.

@Copilot Copilot AI requested a review from waldekmastykarz July 2, 2025 11:03
Copilot finished work on behalf of waldekmastykarz July 2, 2025 11:03
@waldekmastykarz waldekmastykarz marked this pull request as ready for review July 2, 2025 11:18
@waldekmastykarz waldekmastykarz requested a review from a team as a code owner July 2, 2025 11:18
@waldekmastykarz waldekmastykarz enabled auto-merge (squash) July 2, 2025 11:18
@waldekmastykarz waldekmastykarz disabled auto-merge July 2, 2025 12:38
@waldekmastykarz waldekmastykarz merged commit 3658a74 into main Jul 2, 2025
4 checks passed
@waldekmastykarz waldekmastykarz deleted the copilot/fix-1288 branch July 2, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Linux setup script to allow Enter key as default confirmation (Y)
2 participants