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

fix: restore cursor visibility in case of errors #154

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

yalhyane
Copy link
Contributor

The spinner.start function from clack@promts package hides terminal cursor, in case of errors the cursor remains hidden. To fix this, I've added a call to spinner.stop() before throwing errors. This will unhide the cursor,

} catch (error) {
s.stop('The AI is analyzing your changes');
throw error;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to finally block so we don't need to catch or re-throw the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to finally block and keep the stop message the same in both cases.

staged!.diff,
config.generate,
);
let messages;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this type any?

@privatenumber
Copy link
Collaborator

Thanks for the PR. Hopefully we can revert this soon: natemoo-re/clack#106

@privatenumber privatenumber merged commit 51a8bb0 into Nutlope:develop Mar 14, 2023
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.

None yet

2 participants