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 inability to read user input after app exit #622

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

matteodepalo
Copy link
Contributor

@matteodepalo matteodepalo commented Sep 5, 2023

There is a bug I introduced with #616

If someone invokes render once with a component that uses useInput, then everything works fine (and that's why tests are passing).
If instead you invoke render, wait for Ink to exit and then later in the execution you invoke it again with the same component, then node just quits because stdin has been dereferenced in the previous call to render.

With this PR I add a call to ref so that when the second call happens node stays up.

@vadimdemedes
Copy link
Owner

Thanks!

@vadimdemedes vadimdemedes changed the title Add ref() call to stdin when setting raw mode Fix inability to read user input after app exit Sep 9, 2023
@vadimdemedes vadimdemedes merged commit 45dcc1e into vadimdemedes:master Sep 9, 2023
3 checks passed
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.

2 participants