-
Notifications
You must be signed in to change notification settings - Fork 761
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
C3: Fix disappearing cursor after early exit #4087
Conversation
🦋 Changeset detectedLatest commit: 3fed1fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6395573058/npm-package-wrangler-4087 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6395573058/npm-package-wrangler-4087 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6395573058/npm-package-wrangler-4087 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6395573058/npm-package-cloudflare-pages-shared-4087 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
When you use C3 the cursor disappears (in some paths, especially the framework ones, I don't think this happens always always), this makes it inconvenient for example to modify the app name you're providing. In a conversation we had a while back I understood that the disappearance of the cursor in C3 is not intentional. In this PR your are making it re-appear after C3 terminates if the user cancels the operation, this does make things better but I don't think this is the proper solution, shouldn't we fix the issue at the root and not have the cursor disappear in the first place? |
It happens whenever you are in the middle of a clack select or confirm prompt and you cancel.
The root cause is that clack hides the cursor via ansi escape codes whenever a select or confirm prompt is rendered. It does this for good reason, since having a cursor in addition to the artificial cursor affordance we give would be confusing. Imagine having another cursor in this select list: Since we're using custom prompts instead of the built-in prompts that clack provides (due to us wanting to have more fine grained control over the rendering step), it's on us to handle restoring the cursor state. This change does it almost identically to how clack handles it. |
2af0669
to
3fed1fa
Compare
@jculvey ah ok I see, thanks a bunch for the explanation ❤️ If that's the case I'd imagine that then this solution is ok, but I still think that there's more to do regarding the cursor? As I mentioned it looks like the cursor is not even showing when you're providing a name/directory for your app: anyways if that's a different thing and is not conflicting with the current solution then I'm ok with going forward with this (and hopefully handle the broader cursor issue later on?) |
Fixes #3835.
What this PR solves / how to test:
This solves an issue where exiting c3 early via ctrl+c causes the terminal cursor to become hidden.
Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.