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

Added a function that reads a key with cursor hidden #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mitsuhiko
Copy link
Collaborator

Proposed API to read a key with cursor hidden. This would make the common case of cursors disappearing on ctrl-c less common as this is the most common case right now where cursors are hidden.

So rather than hiding cursors all the time, this would hide the cursor just while waiting for the key press and reset it afterwards.

Refs console-rs/dialoguer#294

@mitsuhiko
Copy link
Collaborator Author

I think solving this on windows will be a pain, likewise killing the program by sending a signal in is also going to bypass this. I wonder now if it would not be better to provide an API to just reset the terminal to a reasonable default on shutdown with a utility function and to encourage people to use this.

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

1 participant