Skip to content
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

create-astro ignores Ctrl-C while copying template (or otherwise busy) #6165

Closed
1 task
mrienstra opened this issue Feb 7, 2023 · 1 comment
Closed
1 task
Assignees
Labels
pkg: create-astro Related to the `create-astro` package (scope)

Comments

@mrienstra
Copy link
Contributor

mrienstra commented Feb 7, 2023

What version of astro are you using?

@next--refactor (merged into main, but not in a release yet)

Are you using an SSR adapter? If so, which one?

n/a

What package manager are you using?

pnpm, yarn, & npm

What operating system are you using?

macOS 12.6.3 (latest release of Monterey), M1 hardware

Describe the Bug

While running create-astro via pnpm create astro@next--refactor (or npm create astro@next--refactor or yarn create astro@next--refactor), during the "Template copying..." step, Ctrl-C is ignored. I think this more generally occurs whenever it's not waiting (listening) for user input, e.g. while installing dependencies. Visually, the lines above it disappear each time Ctrl-C is pressed (one line each time). When copying (or whatever) is complete, create-astro continues on to the next step as if nothing were amiss.

After the next create-astro release occurs, it should be possible to reproduce by running pnpm create astro@latest (ditto with yarn & npm), since #6082 has been merged into main.

Initial impression: Though disconcerting when encountered -- and not particularly friendly -- fixing this seems fairly low priority, as most users will not encounter this bug. Also imagining this may turn out to be something that should be addressed in https://github.com/withastro/cli-kit.

Reproduced with:

Latest node v16 release, v16.19.0: npm v8.19.3, pnpm 7.26.3, yarn 3.4.1.
Latest node v18 release, v18.14.0: npm v9.3.1, pnpm 7.26.3, yarn 3.4.1.
Latest node v19 release, v19.6.0: npm v9.4.0, pnpm 7.26.3, yarn 3.4.1.

It can be tough to reproduce if you have a fast network connection. I worked around this by using "Network Link Conditioner", from https://developer.apple.com/download/all/ -- I have Xcode 13.2, so I downloaded "Additional Tools for Xcode 13.2", then installed "Network Link Conditioner.prefPane", found inside the "Hardware" folder. Toggle "Very Bad Network" as needed. I was able to reproduce this many times with a "naturally" slow network connection, so this bug is definitely not limited to the usage of "Network Link Conditioner".

Link to Minimal Reproducible Example

n/a

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re
Copy link
Member

I can confirm that this has been fixed! Ctrl-C should now be respected when the spinner is active and we'll automatically process.exit(0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

No branches or pull requests

2 participants